ALib C++ Library
Library Version: 2402 R1
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 104 of file format.hpp.

#include <format.hpp>

Public Field Index:

integer minPad
 
integer reference
 
TChar tabChar
 
integer tabSize
 

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 118 of file format.hpp.

◆ 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 115 of file format.hpp.

◆ tabChar

template<typename TChar >
TChar tabChar

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

Definition at line 122 of file format.hpp.

◆ tabSize

template<typename TChar >
integer tabSize

The tab positions are multiples of this value.

Definition at line 108 of file format.hpp.

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 135 of file format.hpp.


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