Inherits YGP::ParseText.
Inherited by YGP::CBParseTextEsc, YGP::OFParseTextEsc< T >, and YGP::ParseQuotedEsc.
Public Member Functions | |
ParseTextEsc (const char *abort, const char *description, unsigned int max, unsigned int min=1, char escape= '\\', bool skipWhitespace=true, bool reportData=true) | |
ParseTextEsc (const ParseTextEsc &other) | |
virtual | ~ParseTextEsc () |
ParseTextEsc & | operator= (const ParseTextEsc &other) |
Protected Member Functions | |
virtual int | checkValue (char ch) |
Protected Attributes | |
char | esc |
char | last |
However, parsing is continued if those characters are preceeded by a escape-character (which "escapes" the special meaning of that character).
Parsing of this element is stopped, if any of the characters in the abort-parameters is found (or the maximal cardinality is reached).
This class enables parsing analogue to strings in C. A C-string is terminated with a quote ("), except if the quote follows a single backslash (\). The only difference is that both quote and backslash can be specified and therefor be every charcter.
See ParseObject for a general description of the parser.
YGP::ParseTextEsc::ParseTextEsc | ( | const char * | abort, | |
const char * | description, | |||
unsigned int | max, | |||
unsigned int | min = 1 , |
|||
char | escape = '\\' , |
|||
bool | skipWhitespace = true , |
|||
bool | reportData = true | |||
) |
Constructor; sets the neccessary data of this object.
abort | List of valid characters | |
description | Description of the object (what it parses) | |
max | Maximal cardinality, how often can the object be parsed | |
min | Minimal cardinality, how often must the object be parsed | |
escape | Character which escapes characters in value | |
skipWhitespace | Flag if trailing whitespaces should be skipped after sucessfully parsing the object | |
reportData | Flag if parsed data should be stored and reported via the virtual found method |
YGP::ParseTextEsc::ParseTextEsc | ( | const ParseTextEsc & | other | ) |
Copy-constructor.
other | Object to clone |
YGP::ParseTextEsc::~ParseTextEsc | ( | ) | [virtual] |
Destructor.
int YGP::ParseTextEsc::checkValue | ( | char | ch | ) | [protected, virtual] |
Checks if the parsed value is according the abort-list of the object.
Valid are every characters NOT in pValue or even those if they are preceeded ("escaped") by the character specified by escape (unless this itself is preceeded by itself).
ch | Char to check |
Reimplemented from YGP::ParseText.
Reimplemented in YGP::ParseQuotedEsc.
ParseTextEsc & YGP::ParseTextEsc::operator= | ( | const ParseTextEsc & | other | ) |
char YGP::ParseTextEsc::esc [protected] |
Character escaping the end character(s).
char YGP::ParseTextEsc::last [protected] |
Last parsed character.