ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | List of all members
TFormat< TChar >::Escape Struct Reference

#include <format.hpp>

Class Description

template<typename TChar>
struct aworx::lib::strings::TFormat< TChar >::Escape


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.

Definition at line 233 of file format.hpp.

Public Fields

integer length
 
Switch pSwitch
 
integer startIdx
 

Public Methods

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

Constructor & Destructor Documentation

◆ Escape()

Escape ( Switch  escape = 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 255 of file format.hpp.

Member Data Documentation

◆ length

integer length

The length of the region to convert.

Definition at line 244 of file format.hpp.

◆ pSwitch

Switch pSwitch

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

Definition at line 238 of file format.hpp.

◆ startIdx

integer startIdx

The start of the region to convert.

Definition at line 241 of file format.hpp.


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