ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
TFormat< TChar >::Tab Struct Reference

Description:

template<typename TChar>
struct alib::strings::TFormat< TChar >::Tab

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.

Definition at line 103 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:

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

Field Details:

◆ minPad

template<typename TChar >
integer minPad

The minimum pad characters to add. Defaults to 1.

Definition at line 116 of file format.inl.

◆ reference

template<typename TChar >
integer 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 113 of file format.inl.

◆ tabChar

template<typename TChar >
TChar tabChar

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

Definition at line 120 of file format.inl.

◆ tabSize

template<typename TChar >
integer tabSize

The tab positions are multiples of this value.

Definition at line 107 of file format.inl.

Constructor(s) / Destructor Details:

◆ Tab()

template<typename TChar >
Tab ( 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 131 of file format.inl.


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