edbee - Qt Editor Library
Public Member Functions | List of all members
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. More...
 
QList< int > tabColumnOffsets (const QString &str, int tabSize)
 This method returns all tab-column offsets of the given string. More...
 
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. More...
 

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 ( begin1,
end1,
begin2,
end2,
bool  exclusive = false,
T *  resultBegin = 0,
T *  resultEnd = 0 
)
inline

This method calculates 2 intersections between 2 ranges.

Parameters
exclusiveals het exclusief is dan wordt een overlap niet inclusief. In other words:
  • Inclusive: end < begin
  • Exclusive: end <= begin
resultBegina pointer to the variable recieving the result
resultEnda pointer to the variable recieving 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: