Template Function InterpretCText#

Function Documentation#

template<typename TLiteral, typename TCharType>
inline void InterpretCText(TLiteral rtLiteral, const char *szDelim, std::basic_string<TCharType> &rssText, uint32_t &ruiByteCnt, bool bIgnoreEscape = false, bool bNotUnicode = false)#

Get the characters within a string or character (sequence) literal.

Get the characters for a string or a character sequence (a single character is a character sequence of one character). The characters in the string that are represented through escape sequences are interpreted. This includes C-style string standard characters used for whitespace and quotation markers as well as special Unicode characters only presented by Unicode points within the string. Unicode codepoints could be needing more than one physical character to be represented.

Template Parameters:
  • TLiteral – The type of the variable holding the literal (either const char* or CCodePos).

  • TCharType – The character type to use for the text generation.

Parameters:
  • rtLiteral[inout] The literal text to get the characters for (not including the prefix and quote symbol).

  • szDelim[in] Delimiter to use for detection of the end of the string (will not be included in the result). If nullptr interprets the complete string.

  • rssText[out] Reference to the string receiving the characters.

  • ruiByteCnt[out] Reference to the variable receiving the byte count.

  • bIgnoreEscape[in] When set, do not interpret escape characters.

  • bNotUnicode[in] When set, the encoding is ASCII. Only valid with ‘char’ data type.

Throws:

Can – throw a CCompileException exception if invalid combinations where detected.

Returns:

Returns a vector with the characters that have been read and interpreted.