#include <Parser.h>
Classes | |
| struct | AutoRestoreNext |
| struct | BracketPair |
| struct | Config |
| struct | Proprietary |
Public Types | |
| typedef std::vector< BracketPair > | BracketPairs |
| typedef std::vector< Proprietary > | Proprietaries |
Public Member Functions | |
| const Config & | get_config () const |
| const string_type & | get_code () const |
| size_t | get_next () const |
Static Public Member Functions | |
| static bool | is_digit (char_type chr) |
| static bool | is_digitnz (char_type chr) |
| static bool | is_letter (char_type chr) |
| static bool | is_lower (char_type chr) |
| static bool | is_upper (char_type chr) |
| static bool | is_whitespace (char_type chr) |
| static bool | is_separator (char_type chr) |
| static bool | is_control (char_type chr) |
Static Public Attributes | |
| static const cl7::char_type | CH_NUL = TEXT('\0') |
| static const cl7::char_type | CH_HT = TEXT('\t') |
| static const cl7::char_type | CH_LF = TEXT('\n') |
| static const cl7::char_type | CH_VT = TEXT('\v') |
| static const cl7::char_type | CH_FF = TEXT('\f') |
| static const cl7::char_type | CH_CR = TEXT('\r') |
| static const cl7::char_type | CH_SPACE = TEXT(' ') |
| static const cl7::char_type | CH_BACKSLASH = TEXT('\\') |
| static const cl7::char_type | CH_DOUBLE_QUOTE = TEXT('"') |
| static const cl7::char_type | CH_SINGLE_QUOTE = TEXT('\'') |
| static const cl7::char_type | CH_OPENING_ROUND = TEXT('(') |
| static const cl7::char_type | CH_CLOSING_ROUND = TEXT(')') |
| static const cl7::char_type | CH_OPENING_SQUARE = TEXT('[') |
| static const cl7::char_type | CH_CLOSING_SQUARE = TEXT(']') |
| static const cl7::char_type | CH_OPENING_CURLY = TEXT('{') |
| static const cl7::char_type | CH_CLOSING_CURLY = TEXT('}') |
| static const cl7::char_type | CH_OPENING_ANGLE = TEXT('<') |
| static const cl7::char_type | CH_CLOSING_ANGLE = TEXT('>') |
Protected Member Functions | |
| Parser (void) | |
| Parser (const Config &config) | |
| virtual | ~Parser (void) |
| void | init (const Config &config) |
| void | reset (const string_type &code) |
| char_type | next () |
| string_type | next (size_t n) |
| size_t | skip (size_t n) |
| size_t | skip_whitespace () |
| size_t | stuff_whitespace () |
| size_t | stuff_chr (char_type chr, bool ignore_case=false) |
| size_t | stuff_str (const string_type &str, bool ignore_case=false) |
| bool | begins_with (char_type chr, bool ignore_case=false) |
| bool | begins_with (const string_type &str, bool ignore_case=false) |
| size_t | parse_bracket_term (const BracketPair &b, string_type *result=NULL) |
| size_t | parse_proprietary_section (const Proprietary &p, string_type *result=NULL) |
| size_t | find (const string_type &str, bool ignore_case=false, size_t npos=0, size_t ofs=0) |
| size_t | find_outside (const string_type &str, bool ignore_case=false, size_t npos=0, size_t ofs=0, size_t search_ofs=0) |
| size_t | find_outside (const Config &config, const string_type &str, bool ignore_case=false, size_t npos=0, size_t ofs=0, size_t search_ofs=0) |
| typedef std::vector<BracketPair> cl7::strings::Parser::BracketPairs |
| typedef std::vector<Proprietary> cl7::strings::Parser::Proprietaries |
| cl7::strings::Parser::Parser | ( | void | ) | [protected] |
Default constructor.
Reimplemented in xl7::xml::Parser.
| cl7::strings::Parser::Parser | ( | const Config & | config | ) | [protected] |
Explicit constructor.
| cl7::strings::Parser::~Parser | ( | void | ) | [protected, virtual] |
Destructor.
Reimplemented in xl7::xml::Parser.
| bool cl7::strings::Parser::begins_with | ( | char_type | chr, | |
| bool | ignore_case = false | |||
| ) | [protected] |
Checks whether the next character matches the given one.
| bool cl7::strings::Parser::begins_with | ( | const string_type & | str, | |
| bool | ignore_case = false | |||
| ) | [protected] |
Checks whether the next characters match the given string.
| size_t cl7::strings::Parser::find | ( | const string_type & | str, | |
| bool | ignore_case = false, |
|||
| size_t | npos = 0, |
|||
| size_t | ofs = 0 | |||
| ) | [protected] |
Searches for the given string.
| size_t cl7::strings::Parser::find_outside | ( | const string_type & | str, | |
| bool | ignore_case = false, |
|||
| size_t | npos = 0, |
|||
| size_t | ofs = 0, |
|||
| size_t | search_ofs = 0 | |||
| ) | [protected] |
Searches for the given string by skipping bracket terms and proprietary sections.
| size_t cl7::strings::Parser::find_outside | ( | const Config & | config, | |
| const string_type & | str, | |||
| bool | ignore_case = false, |
|||
| size_t | npos = 0, |
|||
| size_t | ofs = 0, |
|||
| size_t | search_ofs = 0 | |||
| ) | [protected] |
Searches for the given string by skipping bracket terms and proprietary sections.
| const string_type& cl7::strings::Parser::get_code | ( | ) | const [inline] |
Returns the code to parse.
| const Config& cl7::strings::Parser::get_config | ( | ) | const [inline] |
Returns the config structure.
| size_t cl7::strings::Parser::get_next | ( | ) | const [inline] |
Returns the pointer to the next character to parse.
| void cl7::strings::Parser::init | ( | const Config & | config | ) | [protected] |
Initializes the internal config structure.
| bool cl7::strings::Parser::is_control | ( | char_type | chr | ) | [static] |
Returns true, if the given character is a control character.
| bool cl7::strings::Parser::is_digit | ( | char_type | chr | ) | [static] |
Returns true, if the given character represents a decimal digit in the range 0 through 9.
| bool cl7::strings::Parser::is_digitnz | ( | char_type | chr | ) | [static] |
Returns true, if the given character represents a "positive" decimal digit in the range 1 through 9.
| bool cl7::strings::Parser::is_letter | ( | char_type | chr | ) | [static] |
Returns true, if the given character is categorized as a letter.
| bool cl7::strings::Parser::is_lower | ( | char_type | chr | ) | [static] |
Returns true, if the given character is categorized as a lowercase letter.
| bool cl7::strings::Parser::is_separator | ( | char_type | chr | ) | [static] |
Returns true, if the given character is categorized as a separator character.
| bool cl7::strings::Parser::is_upper | ( | char_type | chr | ) | [static] |
Returns true, if the given character is categorized as a uppercase letter.
| bool cl7::strings::Parser::is_whitespace | ( | char_type | chr | ) | [static] |
Returns true, if the given character represents "whitespace".
| char_type cl7::strings::Parser::next | ( | ) | [protected] |
Returns the next character.
| string_type cl7::strings::Parser::next | ( | size_t | n | ) | [protected] |
Returns the next n characters.
| size_t cl7::strings::Parser::parse_bracket_term | ( | const BracketPair & | b, | |
| string_type * | result = NULL | |||
| ) | [protected] |
Parses a bracket term whose attributes are defined by the given structure.
| size_t cl7::strings::Parser::parse_proprietary_section | ( | const Proprietary & | p, | |
| string_type * | result = NULL | |||
| ) | [protected] |
Parses a proprietary section whose attributes are defined by the given structure.
| void cl7::strings::Parser::reset | ( | const string_type & | code | ) | [protected] |
Initializes the code to parse and resets the internal state.
| size_t cl7::strings::Parser::skip | ( | size_t | n | ) | [protected] |
Skips the next n characters.
| size_t cl7::strings::Parser::skip_whitespace | ( | ) | [protected] |
Skips whitespace characters.
| size_t cl7::strings::Parser::stuff_chr | ( | char_type | chr, | |
| bool | ignore_case = false | |||
| ) | [protected] |
Tries to "stuff" the given character.
| size_t cl7::strings::Parser::stuff_str | ( | const string_type & | str, | |
| bool | ignore_case = false | |||
| ) | [protected] |
Tries to "stuff" the characters of the given string.
| size_t cl7::strings::Parser::stuff_whitespace | ( | ) | [protected] |
Tries to "stuff" at least one whitespace character.
const cl7::char_type cl7::strings::Parser::CH_BACKSLASH = TEXT('\\') [static] |
Backslash.
const cl7::char_type cl7::strings::Parser::CH_CLOSING_ANGLE = TEXT('>') [static] |
Closing angle bracket.
const cl7::char_type cl7::strings::Parser::CH_CLOSING_CURLY = TEXT('}') [static] |
Closing curly bracket.
const cl7::char_type cl7::strings::Parser::CH_CLOSING_ROUND = TEXT(')') [static] |
Closing round bracket.
const cl7::char_type cl7::strings::Parser::CH_CLOSING_SQUARE = TEXT(']') [static] |
Closing square bracket.
const cl7::char_type cl7::strings::Parser::CH_CR = TEXT('\r') [static] |
Carriage return (0x0d: 13).
const cl7::char_type cl7::strings::Parser::CH_DOUBLE_QUOTE = TEXT('"') [static] |
Double quote.
const cl7::char_type cl7::strings::Parser::CH_FF = TEXT('\f') [static] |
Form feed (0x0c: 12).
const cl7::char_type cl7::strings::Parser::CH_HT = TEXT('\t') [static] |
Horizontal tab (0x09: 9).
const cl7::char_type cl7::strings::Parser::CH_LF = TEXT('\n') [static] |
Line feed (0x0a: 10).
const cl7::char_type cl7::strings::Parser::CH_NUL = TEXT('\0') [static] |
Null character (0x00: 0).
const cl7::char_type cl7::strings::Parser::CH_OPENING_ANGLE = TEXT('<') [static] |
Opening angle bracket.
const cl7::char_type cl7::strings::Parser::CH_OPENING_CURLY = TEXT('{') [static] |
Opening curly bracket.
const cl7::char_type cl7::strings::Parser::CH_OPENING_ROUND = TEXT('(') [static] |
Opening round bracket.
const cl7::char_type cl7::strings::Parser::CH_OPENING_SQUARE = TEXT('[') [static] |
Opening square bracket.
const cl7::char_type cl7::strings::Parser::CH_SINGLE_QUOTE = TEXT('\'') [static] |
Single quote.
const cl7::char_type cl7::strings::Parser::CH_SPACE = TEXT(' ') [static] |
Space (0x20: 32).
const cl7::char_type cl7::strings::Parser::CH_VT = TEXT('\v') [static] |
Vertical tab (0x0b: 11).
1.7.1