edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
edbee::Util Class Reference

A global utiltity class. The purpose of this class is to put 'global' function that don't quite fit on other places. More...

#include <util.h>

+ Collaboration diagram for edbee::Util:

Public Member Functions

QString convertTabsToSpaces (const QString &str, int tabSize)
 Converst all tabs to sapces of the given string, using the current tab/indent settings It converts "\t" to spaces.
 
QList< int > tabColumnOffsets (const QString &str, int tabSize)
 This method returns all tab-column offsets of the given string.
 
template<typename T>
bool intersection (T begin1, T end1, T begin2, T end2, bool exclusive=false, T *resultBegin=0, T *resultEnd=0)
 This method calculates 2 intersections between 2 ranges.
 

Detailed Description

A global utiltity class. The purpose of this class is to put 'global' function that don't quite fit on other places.

You can use this class like this: Util().converTabsToSpaces()

Member Function Documentation

◆ convertTabsToSpaces()

QString edbee::Util::convertTabsToSpaces ( const QString & str,
int tabSize )

Converst all tabs to sapces of the given string, using the current tab/indent settings It converts "\t" to spaces.

Parameters
strthe string where to convert the tabs to space
tabSizethe size of a single tab. This needs to be at least 1
Returns
A string with all tabs converted to spaces

◆ intersection()

template<typename T>
bool edbee::Util::intersection ( T begin1,
T end1,
T begin2,
T end2,
bool exclusive = false,
T * resultBegin = 0,
T * resultEnd = 0 )
inline

This method calculates 2 intersections between 2 ranges.

Parameters
exclusiveif it is exclusive then an overlap will not be included. In other words:
  • Inclusive: end < begin
  • Exclusive: end <= begin
resultBegina pointer to the variable receiving the result
resultEnda pointer to the variable receiving the result
Returns
false => no overlap, true => overlap

◆ tabColumnOffsets()

QList< int > edbee::Util::tabColumnOffsets ( const QString & str,
int tabSize )

This method returns all tab-column offsets of the given string.

Parameters
strthe string to convert
tabSizethe tab size to use for conversion
Returns
a vector with the character-offset in the given string that contains the given tab-column

The documentation for this class was generated from the following files: