Rapicorn - Experimental UI Toolkit - Source Code
13.07.0
|
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< String > | ConstStrings |
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 MarkupParser * | create_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 String & | recap_string () const |
g_markup_escape_text:
text | some valid UTF-8 text |
length | length 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