pugi Namespace Reference

pugi Namespace Reference

Classes

class  xml_attribute
 
class  xml_attribute_iterator
 
class  xml_document
 
class  xml_named_node_iterator
 
class  xml_node
 
class  xml_node_iterator
 
class  xml_object_range
 
struct  xml_parse_result
 
class  xml_text
 
class  xml_tree_walker
 
class  xml_writer
 
class  xml_writer_file
 
class  xml_writer_stream
 
class  xpath_exception
 
class  xpath_node
 
class  xpath_node_set
 
struct  xpath_parse_result
 
class  xpath_query
 
class  xpath_variable
 
class  xpath_variable_set
 

Typedefs

typedef char char_t
 
typedef std::basic_string< char, std::char_traits< char >, std::allocator< char > > string_t
 
typedef void *(* allocation_function) (size_t size)
 
typedef void(* deallocation_function) (void *ptr)
 

Enumerations

enum  xml_node_type {
  node_null, node_document, node_element, node_pcdata,
  node_cdata, node_comment, node_pi, node_declaration,
  node_doctype
}
 
enum  xml_encoding {
  encoding_auto, encoding_utf8, encoding_utf16_le, encoding_utf16_be,
  encoding_utf16, encoding_utf32_le, encoding_utf32_be, encoding_utf32,
  encoding_wchar, encoding_latin1
}
 
enum  xml_parse_status {
  status_ok = 0, status_file_not_found, status_io_error, status_out_of_memory,
  status_internal_error, status_unrecognized_tag, status_bad_pi, status_bad_comment,
  status_bad_cdata, status_bad_doctype, status_bad_pcdata, status_bad_start_element,
  status_bad_attribute, status_bad_end_element, status_end_element_mismatch
}
 
enum  xpath_value_type {
  xpath_type_none, xpath_type_node_set, xpath_type_number, xpath_type_string,
  xpath_type_boolean
}
 

Functions

std::basic_string< char, std::char_traits< char >, std::allocator< char > > as_utf8 (const wchar_t *str)
 
std::basic_string< char, std::char_traits< char >, std::allocator< char > > as_utf8 (const std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > &str)
 
std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > as_wide (const char *str)
 
std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > as_wide (const std::basic_string< char, std::char_traits< char >, std::allocator< char > > &str)
 
void set_memory_management_functions (allocation_function allocate, deallocation_function deallocate)
 
allocation_function get_memory_allocation_function ()
 
deallocation_function get_memory_deallocation_function ()
 

Variables

const unsigned int parse_minimal = 0x0000
 
const unsigned int parse_pi = 0x0001
 
const unsigned int parse_comments = 0x0002
 
const unsigned int parse_cdata = 0x0004
 
const unsigned int parse_ws_pcdata = 0x0008
 
const unsigned int parse_escapes = 0x0010
 
const unsigned int parse_eol = 0x0020
 
const unsigned int parse_wconv_attribute = 0x0040
 
const unsigned int parse_wnorm_attribute = 0x0080
 
const unsigned int parse_declaration = 0x0100
 
const unsigned int parse_doctype = 0x0200
 
const unsigned int parse_ws_pcdata_single = 0x0400
 
const unsigned int parse_default = parse_cdata | parse_escapes | parse_wconv_attribute | parse_eol
 
const unsigned int parse_full = parse_default | parse_pi | parse_comments | parse_declaration | parse_doctype
 
const unsigned int format_indent = 0x01
 
const unsigned int format_write_bom = 0x02
 
const unsigned int format_raw = 0x04
 
const unsigned int format_no_declaration = 0x08
 
const unsigned int format_no_escapes = 0x10
 
const unsigned int format_save_file_text = 0x20
 
const unsigned int format_default = format_indent
 

Typedef Documentation

typedef void*(* allocation_function) (size_t size)

Definition at line 1207 of file pugixml.hpp.

typedef char char_t

Definition at line 78 of file pugixml.hpp.

typedef void(* deallocation_function) (void *ptr)

Definition at line 1210 of file pugixml.hpp.

typedef std::basic_string< char , std::char_traits< char >, std::allocator< char > > string_t

Definition at line 82 of file pugixml.hpp.

Enumeration Type Documentation

Enumerator
encoding_auto 
encoding_utf8 
encoding_utf16_le 
encoding_utf16_be 
encoding_utf16 
encoding_utf32_le 
encoding_utf32_be 
encoding_utf32 
encoding_wchar 
encoding_latin1 

Definition at line 156 of file pugixml.hpp.

157  {
158  encoding_auto, // Auto-detect input encoding using BOM or < / <? detection; use UTF8 if BOM is not found
159  encoding_utf8, // UTF8 encoding
160  encoding_utf16_le, // Little-endian UTF16
161  encoding_utf16_be, // Big-endian UTF16
162  encoding_utf16, // UTF16 with native endianness
163  encoding_utf32_le, // Little-endian UTF32
164  encoding_utf32_be, // Big-endian UTF32
165  encoding_utf32, // UTF32 with native endianness
166  encoding_wchar, // The same encoding wchar_t has (either UTF16 or UTF32)
168  };
Enumerator
node_null 
node_document 
node_element 
node_pcdata 
node_cdata 
node_comment 
node_pi 
node_declaration 
node_doctype 

Definition at line 90 of file pugixml.hpp.

91  {
92  node_null, // Empty (null) node handle
93  node_document, // A document tree's absolute root
94  node_element, // Element tag, i.e. '<node/>'
95  node_pcdata, // Plain character data, i.e. 'text'
96  node_cdata, // Character data, i.e. '<![CDATA[text]]>'
97  node_comment, // Comment tag, i.e. '<!-- text -->'
98  node_pi, // Processing instruction, i.e. '<?name?>'
99  node_declaration, // Document declaration, i.e. '<?xml version="1.0"?>'
100  node_doctype // Document type declaration, i.e. '<!DOCTYPE doc>'
101  };
Enumerator
status_ok 
status_file_not_found 
status_io_error 
status_out_of_memory 
status_internal_error 
status_unrecognized_tag 
status_bad_pi 
status_bad_comment 
status_bad_cdata 
status_bad_doctype 
status_bad_pcdata 
status_bad_start_element 
status_bad_attribute 
status_bad_end_element 
status_end_element_mismatch 

Definition at line 804 of file pugixml.hpp.

805  {
806  status_ok = 0, // No error
807 
808  status_file_not_found, // File was not found during load_file()
809  status_io_error, // Error reading from file/stream
810  status_out_of_memory, // Could not allocate memory
811  status_internal_error, // Internal error occurred
812 
813  status_unrecognized_tag, // Parser could not determine tag type
814 
815  status_bad_pi, // Parsing error occurred while parsing document declaration/processing instruction
816  status_bad_comment, // Parsing error occurred while parsing comment
817  status_bad_cdata, // Parsing error occurred while parsing CDATA section
818  status_bad_doctype, // Parsing error occurred while parsing document type declaration
819  status_bad_pcdata, // Parsing error occurred while parsing PCDATA section
820  status_bad_start_element, // Parsing error occurred while parsing start element tag
821  status_bad_attribute, // Parsing error occurred while parsing element attribute
822  status_bad_end_element, // Parsing error occurred while parsing end element tag
823  status_end_element_mismatch // There was a mismatch of start-end tags (closing tag had incorrect name, some tag was not closed or there was an excessive closing tag)
824  };
Enumerator
xpath_type_none 
xpath_type_node_set 
xpath_type_number 
xpath_type_string 
xpath_type_boolean 

Definition at line 921 of file pugixml.hpp.

922  {
923  xpath_type_none, // Unknown type (query failed to compile)
924  xpath_type_node_set, // Node set (xpath_node_set)
925  xpath_type_number, // Number
926  xpath_type_string, // String
927  xpath_type_boolean // Boolean
928  };

Function Documentation

std::basic_string<char, std::char_traits<char>, std::allocator<char> > pugi::as_utf8 ( const wchar_t *  str)
std::basic_string<char, std::char_traits<char>, std::allocator<char> > pugi::as_utf8 ( const std::basic_string< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > &  str)
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > pugi::as_wide ( const char *  str)
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > pugi::as_wide ( const std::basic_string< char, std::char_traits< char >, std::allocator< char > > &  str)
allocation_function pugi::get_memory_allocation_function ( )
deallocation_function pugi::get_memory_deallocation_function ( )
void pugi::set_memory_management_functions ( allocation_function  allocate,
deallocation_function  deallocate 
)

Variable Documentation

const unsigned int format_default = format_indent

Definition at line 192 of file pugixml.hpp.

const unsigned int format_indent = 0x01

Definition at line 173 of file pugixml.hpp.

const unsigned int format_no_declaration = 0x08

Definition at line 182 of file pugixml.hpp.

const unsigned int format_no_escapes = 0x10

Definition at line 185 of file pugixml.hpp.

const unsigned int format_raw = 0x04

Definition at line 179 of file pugixml.hpp.

const unsigned int format_save_file_text = 0x20

Definition at line 188 of file pugixml.hpp.

const unsigned int format_write_bom = 0x02

Definition at line 176 of file pugixml.hpp.

const unsigned int parse_cdata = 0x0004

Definition at line 116 of file pugixml.hpp.

const unsigned int parse_comments = 0x0002

Definition at line 113 of file pugixml.hpp.

const unsigned int parse_declaration = 0x0100

Definition at line 135 of file pugixml.hpp.

const unsigned int parse_default = parse_cdata | parse_escapes | parse_wconv_attribute | parse_eol

Definition at line 148 of file pugixml.hpp.

const unsigned int parse_doctype = 0x0200

Definition at line 138 of file pugixml.hpp.

const unsigned int parse_eol = 0x0020

Definition at line 126 of file pugixml.hpp.

const unsigned int parse_escapes = 0x0010

Definition at line 123 of file pugixml.hpp.

Definition at line 153 of file pugixml.hpp.

const unsigned int parse_minimal = 0x0000

Definition at line 107 of file pugixml.hpp.

const unsigned int parse_pi = 0x0001

Definition at line 110 of file pugixml.hpp.

const unsigned int parse_wconv_attribute = 0x0040

Definition at line 129 of file pugixml.hpp.

const unsigned int parse_wnorm_attribute = 0x0080

Definition at line 132 of file pugixml.hpp.

const unsigned int parse_ws_pcdata = 0x0008

Definition at line 120 of file pugixml.hpp.

const unsigned int parse_ws_pcdata_single = 0x0400

Definition at line 143 of file pugixml.hpp.