Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
Rapicorn::MarkupParser Class Reference

List of all members.

Classes

struct  Error

Public Types

enum  ErrorType {
  NONE, READ_FAILED, BAD_UTF8, DOCUMENT_EMPTY,
  PARSE_ERROR, INVALID_ELEMENT, INVALID_ATTRIBUTE, INVALID_CONTENT,
  MISSING_ELEMENT, MISSING_ATTRIBUTE, MISSING_CONTENT
}
typedef const vector< StringConstStrings

Public Member Functions

bool parse (const char *text, ssize_t text_len, Error *error)
bool end_parse (Error *error)
String get_element ()
String input_name ()
void get_position (int *line_number, int *char_number, const char **input_name_p=NULL)
virtual void error (const Error &error)

Static Public Member Functions

static MarkupParsercreate_parser (const String &input_name)
static String escape_text (const String &text)
static String escape_text (const char *text, ssize_t length)
 g_markup_escape_text:
template<class... Args>
static String escape_format_args (const char *format, const Args &...args)

Protected Member Functions

 MarkupParser (const String &input_name)
virtual void start_element (const String &element_name, ConstStrings &attribute_names, ConstStrings &attribute_values, Error &error)
virtual void end_element (const String &element_name, Error &error)
virtual void text (const String &text, Error &error)
virtual void pass_through (const String &pass_through_text, Error &error)
void recap_element (const String &element_name, ConstStrings &attribute_names, ConstStrings &attribute_values, Error &error, bool include_outer=true)
const Stringrecap_string () const

Member Function Documentation

String Rapicorn::MarkupParser::escape_text ( const char text,
ssize_t  length 
) [static]

g_markup_escape_text:

Parameters:
textsome valid UTF-8 text
lengthlength of text in bytes

Escapes text so that the markup parser will parse it verbatim. Less than, greater than, ampersand, etc. are replaced with the corresponding entities. This function would typically be used when writing out a file to be parsed with the markup parser.

Note that this function doesn't protect whitespace and line endings from being processed according to the XML rules for normalization of line endings and attribute values.

Return value: escaped text


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