Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions

cl7::strings::Parser Class Reference

#include <Parser.h>

Inheritance diagram for cl7::strings::Parser:
xl7::xml::Parser

List of all members.

Classes

struct  AutoRestoreNext
struct  BracketPair
struct  Config
struct  Proprietary

Public Types

typedef std::vector< BracketPairBracketPairs
typedef std::vector< ProprietaryProprietaries

Public Member Functions

const Configget_config () const
const string_typeget_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)

Member Typedef Documentation


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


Member Data Documentation

Backslash.

Closing angle bracket.

Closing curly bracket.

Closing round bracket.

Closing square bracket.

const cl7::char_type cl7::strings::Parser::CH_CR = TEXT('\r') [static]

Carriage return (0x0d: 13).

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).

Opening angle bracket.

Opening curly bracket.

Opening round bracket.

Opening square bracket.

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).


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines