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

Description:

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

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

Escapes non-printable characters in the given region, or reversely converts such escaped characters to their ASCII values.

The characters converted are '\\', '\r', '\n', '\t', '\a', '\b', '\v', '\f', '\e' and '"'.

If the new region length is needed to be known, it can be calculated as the sum of the old region length and the difference of the string's length before and after the operation.

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

Definition at line 225 of file format.inl.

Public Field Index:

integer length
 The length of the region to convert.
 
lang::Switch pSwitch
 
integer startIdx
 The start of the region to convert.
 

Public Method Index:

 TEscape (lang::Switch escape=lang::Switch::On, integer regionStart=0, integer regionLength=MAX_LEN)
 

Field Details:

◆ length

template<typename TChar>
integer alib::strings::TEscape< TChar >::length

The length of the region to convert.

Definition at line 236 of file format.inl.

◆ pSwitch

template<typename TChar>
lang::Switch alib::strings::TEscape< TChar >::pSwitch

The direction of conversion: Switch::On escapes ascii characters, while Switch::Off converts escaped strings to ascii codes.

Definition at line 230 of file format.inl.

◆ startIdx

template<typename TChar>
integer alib::strings::TEscape< TChar >::startIdx

The start of the region to convert.

Definition at line 233 of file format.inl.

Constructor(s) / Destructor Details:

◆ TEscape()

template<typename TChar>
alib::strings::TEscape< TChar >::TEscape ( lang::Switch escape = lang::Switch::On,
integer regionStart = 0,
integer regionLength = MAX_LEN )
inline

Constructor. Copies the parameters.

Parameters
escapeSwitch::On escapes ascii characters (the default), Switch::Off converts escaped strings to ascii codes.
regionStartThe start of the region to convert.
regionLengthThe length of the region to convert.

Definition at line 245 of file format.inl.


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