ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::TTab< TChar > Struct Template Reference

Description:

template<typename TChar>
struct alib::strings::TTab< TChar >

Implements a temporary object which is appended to instances of type AString.

Appends tab characters (as provided) to reach a certain length (aka tabulator position) of the target. The tab position is referenced to an optionally given reference value which might be the start of the string or the position of the last newline. If this parameter is negative, the last newline characters are searched from the end of the string backwards.
Referring to that as position 0, the tab position is then located at the next multiple of parameter tabSize, after having added minPad tab characters.

Template Parameters
TCharThe character type of the AString that instances can be "applied" to.

Definition at line 155 of file format.inl.

Public Field Index:

integer minPad
 The minimum pad characters to add. Defaults to 1.
 
integer reference
 
TChar tabChar
 
integer tabSize
 The tab positions are multiples of this value.
 

Public Method Index:

 TTab (integer size, integer referenceIdx=0, integer minPadChars=1, TChar fillChar=' ')
 

Field Details:

◆ minPad

template<typename TChar>
integer alib::strings::TTab< TChar >::minPad

The minimum pad characters to add. Defaults to 1.

Definition at line 167 of file format.inl.

◆ reference

template<typename TChar>
integer alib::strings::TTab< TChar >::reference

The reference length of the AString which is taken as relative tab position (instead of the beginning of the string). If -1, the target AString is searched backwards for the last newline and this position is used as the reference.

Definition at line 164 of file format.inl.

◆ tabChar

template<typename TChar>
TChar alib::strings::TTab< TChar >::tabChar

The character to insert to reach the tab position. Normally this is the space character ' '.

Definition at line 171 of file format.inl.

◆ tabSize

template<typename TChar>
integer alib::strings::TTab< TChar >::tabSize

The tab positions are multiples of this value.

Definition at line 158 of file format.inl.

Constructor(s) / Destructor Details:

◆ TTab()

template<typename TChar>
alib::strings::TTab< TChar >::TTab ( integer size,
integer referenceIdx = 0,
integer minPadChars = 1,
TChar fillChar = ' ' )
inline

Constructor. Copies the parameters.

Parameters
sizeThe tab positions are multiples of this parameter.
referenceIdxThe reference index marking the start of the actual line. If -1, the last new-line character is searched from the end of the string backwards, and used. Defaults to 0.
minPadCharsThe minimum pad characters to add. Defaults to 1.
fillCharThe character to insert to reach the tab position. Defaults to ' ' (space).

Definition at line 182 of file format.inl.


The documentation for this struct was generated from the following file: