NDDEM
|
#include "pugixml.hpp"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <float.h>
#include <istream>
#include <ostream>
#include <string>
#include <new>
#include <stdint.h>
Namespaces | |
pugi | |
Macros | |
#define | SOURCE_PUGIXML_CPP |
#define | PUGI_IMPL_NO_INLINE |
#define | PUGI_IMPL_UNLIKELY(cond) (cond) |
#define | PUGI_IMPL_STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } |
#define | PUGI_IMPL_DMC_VOLATILE |
#define | PUGI_IMPL_UNSIGNED_OVERFLOW |
#define | PUGI_IMPL_SNPRINTF sprintf |
#define | PUGI_IMPL_NS_BEGIN namespace pugi { namespace impl { namespace { |
#define | PUGI_IMPL_NS_END } } } |
#define | PUGI_IMPL_FN |
#define | PUGI_IMPL_FN_NO_INLINE PUGI_IMPL_NO_INLINE |
#define | PUGI_IMPL_GETHEADER_IMPL(object, page, flags) (((reinterpret_cast<char*>(object) - reinterpret_cast<char*>(page)) << 8) | (flags)) |
#define | PUGI_IMPL_GETPAGE_IMPL(header) static_cast<impl::xml_memory_page*>(const_cast<void*>(static_cast<const void*>(reinterpret_cast<const char*>(&header) - (header >> 8)))) |
#define | PUGI_IMPL_GETPAGE(n) PUGI_IMPL_GETPAGE_IMPL((n)->header) |
#define | PUGI_IMPL_NODETYPE(n) static_cast<xml_node_type>((n)->header & impl::xml_memory_page_type_mask) |
#define | PUGI_IMPL_IS_CHARTYPE_IMPL(c, ct, table) (table[static_cast<unsigned char>(c)] & (ct)) |
#define | PUGI_IMPL_IS_CHARTYPE(c, ct) PUGI_IMPL_IS_CHARTYPE_IMPL(c, ct, chartype_table) |
#define | PUGI_IMPL_IS_CHARTYPEX(c, ct) PUGI_IMPL_IS_CHARTYPE_IMPL(c, ct, chartypex_table) |
#define | PUGI_IMPL_SCANCHAR(ch) { if (offset >= size || data[offset] != ch) return false; offset++; } |
#define | PUGI_IMPL_SCANCHARTYPE(ct) { while (offset < size && PUGI_IMPL_IS_CHARTYPE(data[offset], ct)) offset++; } |
#define | PUGI_IMPL_ENDSWITH(c, e) ((c) == (e) || ((c) == 0 && endch == (e))) |
#define | PUGI_IMPL_SKIPWS() { while (PUGI_IMPL_IS_CHARTYPE(*s, ct_space)) ++s; } |
#define | PUGI_IMPL_OPTSET(OPT) ( optmsk & (OPT) ) |
#define | PUGI_IMPL_PUSHNODE(TYPE) { cursor = append_new_node(cursor, *alloc, TYPE); if (!cursor) PUGI_IMPL_THROW_ERROR(status_out_of_memory, s); } |
#define | PUGI_IMPL_POPNODE() { cursor = cursor->parent; } |
#define | PUGI_IMPL_SCANFOR(X) { while (*s != 0 && !(X)) ++s; } |
#define | PUGI_IMPL_SCANWHILE(X) { while (X) ++s; } |
#define | PUGI_IMPL_SCANWHILE_UNROLL(X) { for (;;) { char_t ss = s[0]; if (PUGI_IMPL_UNLIKELY(!(X))) { break; } ss = s[1]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 1; break; } ss = s[2]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 2; break; } ss = s[3]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 3; break; } s += 4; } } |
#define | PUGI_IMPL_ENDSEG() { ch = *s; *s = 0; ++s; } |
#define | PUGI_IMPL_THROW_ERROR(err, m) return error_offset = m, error_status = err, static_cast<char_t*>(0) |
#define | PUGI_IMPL_CHECK_ERROR(err, m) { if (*s == 0) PUGI_IMPL_THROW_ERROR(err, m); } |
Typedefs | |
typedef xml_memory_management_function_storage< int > | xml_memory |
typedef wchar_selector< sizeof(wchar_t)>::counter | wchar_counter |
typedef wchar_selector< sizeof(wchar_t)>::writer | wchar_writer |
typedef char_t *(* | strconv_pcdata_t) (char_t *) |
typedef char_t *(* | strconv_attribute_t) (char_t *, char_t) |
Functions | |
PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN void * | default_allocate (size_t size) |
PUGI_IMPL_FN void | default_deallocate (void *ptr) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN size_t | strlength (const char_t *s) |
PUGI_IMPL_FN bool | strequal (const char_t *src, const char_t *dst) |
PUGI_IMPL_FN bool | strequalrange (const char_t *lhs, const char_t *rhs, size_t count) |
PUGI_IMPL_FN size_t | strlength_wide (const wchar_t *s) |
template<typename Object > | |
xml_allocator & | get_allocator (const Object *object) |
template<typename Object > | |
xml_document_struct & | get_document (const Object *object) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN xml_attribute_struct * | allocate_attribute (xml_allocator &alloc) |
xml_node_struct * | allocate_node (xml_allocator &alloc, xml_node_type type) |
void | destroy_attribute (xml_attribute_struct *a, xml_allocator &alloc) |
void | destroy_node (xml_node_struct *n, xml_allocator &alloc) |
void | append_node (xml_node_struct *child, xml_node_struct *node) |
void | prepend_node (xml_node_struct *child, xml_node_struct *node) |
void | insert_node_after (xml_node_struct *child, xml_node_struct *node) |
void | insert_node_before (xml_node_struct *child, xml_node_struct *node) |
void | remove_node (xml_node_struct *node) |
void | append_attribute (xml_attribute_struct *attr, xml_node_struct *node) |
void | prepend_attribute (xml_attribute_struct *attr, xml_node_struct *node) |
void | insert_attribute_after (xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node) |
void | insert_attribute_before (xml_attribute_struct *attr, xml_attribute_struct *place, xml_node_struct *node) |
void | remove_attribute (xml_attribute_struct *attr, xml_node_struct *node) |
PUGI_IMPL_FN_NO_INLINE xml_node_struct * | append_new_node (xml_node_struct *node, xml_allocator &alloc, xml_node_type type=node_element) |
PUGI_IMPL_FN_NO_INLINE xml_attribute_struct * | append_new_attribute (xml_node_struct *node, xml_allocator &alloc) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN uint16_t | endian_swap (uint16_t value) |
uint32_t | endian_swap (uint32_t value) |
PUGI_IMPL_FN bool | is_little_endian () |
PUGI_IMPL_FN xml_encoding | get_wchar_encoding () |
PUGI_IMPL_FN bool | parse_declaration_encoding (const uint8_t *data, size_t size, const uint8_t *&out_encoding, size_t &out_length) |
PUGI_IMPL_FN xml_encoding | guess_buffer_encoding (const uint8_t *data, size_t size) |
PUGI_IMPL_FN xml_encoding | get_buffer_encoding (xml_encoding encoding, const void *contents, size_t size) |
PUGI_IMPL_FN bool | get_mutable_buffer (char_t *&out_buffer, size_t &out_length, const void *contents, size_t size, bool is_mutable) |
template<typename D > | |
PUGI_IMPL_FN bool | convert_buffer_generic (char_t *&out_buffer, size_t &out_length, const void *contents, size_t size, D) |
PUGI_IMPL_FN size_t | get_latin1_7bit_prefix_length (const uint8_t *data, size_t size) |
PUGI_IMPL_FN bool | convert_buffer_latin1 (char_t *&out_buffer, size_t &out_length, const void *contents, size_t size, bool is_mutable) |
PUGI_IMPL_FN bool | convert_buffer (char_t *&out_buffer, size_t &out_length, xml_encoding encoding, const void *contents, size_t size, bool is_mutable) |
PUGI_IMPL_FN size_t | as_utf8_begin (const wchar_t *str, size_t length) |
PUGI_IMPL_FN void | as_utf8_end (char *buffer, size_t size, const wchar_t *str, size_t length) |
PUGI_IMPL_FN std::string | as_utf8_impl (const wchar_t *str, size_t length) |
PUGI_IMPL_FN std::basic_string< wchar_t > | as_wide_impl (const char *str, size_t size) |
template<typename Header > | |
bool | strcpy_insitu_allow (size_t length, const Header &header, uintptr_t header_mask, char_t *target) |
template<typename String , typename Header > | |
PUGI_IMPL_FN bool | strcpy_insitu (String &dest, Header &header, uintptr_t header_mask, const char_t *source, size_t source_length) |
PUGI_IMPL_FN char_t * | strconv_escape (char_t *s, gap &g) |
PUGI_IMPL_FN char_t * | strconv_comment (char_t *s, char_t endch) |
PUGI_IMPL_FN char_t * | strconv_cdata (char_t *s, char_t endch) |
PUGI_IMPL_FN strconv_pcdata_t | get_strconv_pcdata (unsigned int optmask) |
PUGI_IMPL_FN strconv_attribute_t | get_strconv_attribute (unsigned int optmask) |
xml_parse_result | make_parse_result (xml_parse_status status, ptrdiff_t offset=0) |
PUGI_IMPL_FN xml_encoding | get_write_native_encoding () |
PUGI_IMPL_FN xml_encoding | get_write_encoding (xml_encoding encoding) |
template<typename D , typename T > | |
PUGI_IMPL_FN size_t | convert_buffer_output_generic (typename T::value_type dest, const char_t *data, size_t length, D, T) |
template<typename D , typename T > | |
PUGI_IMPL_FN size_t | convert_buffer_output_generic (typename T::value_type dest, const char_t *data, size_t length, D, T, bool opt_swap) |
PUGI_IMPL_FN size_t | get_valid_length (const char_t *data, size_t length) |
PUGI_IMPL_FN size_t | convert_buffer_output (char_t *, uint8_t *r_u8, uint16_t *r_u16, uint32_t *r_u32, const char_t *data, size_t length, xml_encoding encoding) |
PUGI_IMPL_FN void | text_output_escaped (xml_buffered_writer &writer, const char_t *s, chartypex_t type, unsigned int flags) |
PUGI_IMPL_FN void | text_output (xml_buffered_writer &writer, const char_t *s, chartypex_t type, unsigned int flags) |
PUGI_IMPL_FN void | text_output_cdata (xml_buffered_writer &writer, const char_t *s) |
PUGI_IMPL_FN void | text_output_indent (xml_buffered_writer &writer, const char_t *indent, size_t indent_length, unsigned int depth) |
PUGI_IMPL_FN void | node_output_comment (xml_buffered_writer &writer, const char_t *s) |
PUGI_IMPL_FN void | node_output_pi_value (xml_buffered_writer &writer, const char_t *s) |
PUGI_IMPL_FN void | node_output_attributes (xml_buffered_writer &writer, xml_node_struct *node, const char_t *indent, size_t indent_length, unsigned int flags, unsigned int depth) |
PUGI_IMPL_FN bool | node_output_start (xml_buffered_writer &writer, xml_node_struct *node, const char_t *indent, size_t indent_length, unsigned int flags, unsigned int depth) |
PUGI_IMPL_FN void | node_output_end (xml_buffered_writer &writer, xml_node_struct *node) |
PUGI_IMPL_FN void | node_output_simple (xml_buffered_writer &writer, xml_node_struct *node, unsigned int flags) |
PUGI_IMPL_FN void | node_output (xml_buffered_writer &writer, xml_node_struct *root, const char_t *indent, unsigned int flags, unsigned int depth) |
PUGI_IMPL_FN bool | has_declaration (xml_node_struct *node) |
PUGI_IMPL_FN bool | is_attribute_of (xml_attribute_struct *attr, xml_node_struct *node) |
PUGI_IMPL_FN bool | allow_insert_attribute (xml_node_type parent) |
PUGI_IMPL_FN bool | allow_insert_child (xml_node_type parent, xml_node_type child) |
PUGI_IMPL_FN bool | allow_move (xml_node parent, xml_node child) |
template<typename String , typename Header > | |
PUGI_IMPL_FN void | node_copy_string (String &dest, Header &header, uintptr_t header_mask, char_t *source, Header &source_header, xml_allocator *alloc) |
PUGI_IMPL_FN void | node_copy_contents (xml_node_struct *dn, xml_node_struct *sn, xml_allocator *shared_alloc) |
PUGI_IMPL_FN void | node_copy_tree (xml_node_struct *dn, xml_node_struct *sn) |
PUGI_IMPL_FN void | node_copy_attribute (xml_attribute_struct *da, xml_attribute_struct *sa) |
bool | is_text_node (xml_node_struct *node) |
template<typename U > | |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW U | string_to_integer (const char_t *value, U minv, U maxv) |
PUGI_IMPL_FN int | get_value_int (const char_t *value) |
PUGI_IMPL_FN unsigned int | get_value_uint (const char_t *value) |
PUGI_IMPL_FN double | get_value_double (const char_t *value) |
PUGI_IMPL_FN float | get_value_float (const char_t *value) |
PUGI_IMPL_FN bool | get_value_bool (const char_t *value) |
template<typename U > | |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW char_t * | integer_to_string (char_t *begin, char_t *end, U value, bool negative) |
template<typename String , typename Header > | |
PUGI_IMPL_FN bool | set_value_ascii (String &dest, Header &header, uintptr_t header_mask, char *buf) |
template<typename U , typename String , typename Header > | |
PUGI_IMPL_FN bool | set_value_integer (String &dest, Header &header, uintptr_t header_mask, U value, bool negative) |
template<typename String , typename Header > | |
PUGI_IMPL_FN bool | set_value_convert (String &dest, Header &header, uintptr_t header_mask, float value, int precision) |
template<typename String , typename Header > | |
PUGI_IMPL_FN bool | set_value_convert (String &dest, Header &header, uintptr_t header_mask, double value, int precision) |
template<typename String , typename Header > | |
PUGI_IMPL_FN bool | set_value_bool (String &dest, Header &header, uintptr_t header_mask, bool value) |
PUGI_IMPL_FN xml_parse_result | load_buffer_impl (xml_document_struct *doc, xml_node_struct *root, void *contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own, char_t **out_buffer) |
PUGI_IMPL_FN xml_parse_status | get_file_size (FILE *file, size_t &out_result) |
PUGI_IMPL_FN size_t | zero_terminate_buffer (void *buffer, size_t size, xml_encoding encoding) |
PUGI_IMPL_FN xml_parse_result | load_file_impl (xml_document_struct *doc, FILE *file, unsigned int options, xml_encoding encoding, char_t **out_buffer) |
PUGI_IMPL_FN void | close_file (FILE *file) |
template<typename T > | |
PUGI_IMPL_FN xml_parse_status | load_stream_data_noseek (std::basic_istream< T > &stream, void **out_buffer, size_t *out_size) |
template<typename T > | |
PUGI_IMPL_FN xml_parse_status | load_stream_data_seek (std::basic_istream< T > &stream, void **out_buffer, size_t *out_size) |
template<typename T > | |
PUGI_IMPL_FN xml_parse_result | load_stream_impl (xml_document_struct *doc, std::basic_istream< T > &stream, unsigned int options, xml_encoding encoding, char_t **out_buffer) |
PUGI_IMPL_FN char * | convert_path_heap (const wchar_t *str) |
PUGI_IMPL_FN FILE * | open_file_wide (const wchar_t *path, const wchar_t *mode) |
PUGI_IMPL_FN FILE * | open_file (const char *path, const char *mode) |
PUGI_IMPL_FN bool | save_file_impl (const xml_document &doc, FILE *file, const char_t *indent, unsigned int flags, xml_encoding encoding) |
static PUGI_IMPL_FN void | pugi::unspecified_bool_xml_attribute (xml_attribute ***) |
static PUGI_IMPL_FN void | pugi::unspecified_bool_xml_node (xml_node ***) |
static PUGI_IMPL_FN void | pugi::unspecified_bool_xml_text (xml_text ***) |
PUGI_IMPL_FN std::string PUGIXML_FUNCTION | pugi::as_utf8 (const wchar_t *str) |
PUGI_IMPL_FN std::string PUGIXML_FUNCTION | pugi::as_utf8 (const std::basic_string< wchar_t > &str) |
PUGI_IMPL_FN std::basic_string< wchar_t > PUGIXML_FUNCTION | pugi::as_wide (const char *str) |
PUGI_IMPL_FN std::basic_string< wchar_t > PUGIXML_FUNCTION | pugi::as_wide (const std::string &str) |
PUGI_IMPL_FN void PUGIXML_FUNCTION | pugi::set_memory_management_functions (allocation_function allocate, deallocation_function deallocate) |
PUGI_IMPL_FN allocation_function PUGIXML_FUNCTION | pugi::get_memory_allocation_function () |
PUGI_IMPL_FN deallocation_function PUGIXML_FUNCTION | pugi::get_memory_deallocation_function () |
template<typename T > | |
void | swap (T &lhs, T &rhs) |
template<typename I , typename Pred > | |
PUGI_IMPL_FN I | min_element (I begin, I end, const Pred &pred) |
template<typename I > | |
PUGI_IMPL_FN void | reverse (I begin, I end) |
template<typename I > | |
PUGI_IMPL_FN I | unique (I begin, I end) |
template<typename T , typename Pred > | |
PUGI_IMPL_FN void | insertion_sort (T *begin, T *end, const Pred &pred) |
template<typename I , typename Pred > | |
I | median3 (I first, I middle, I last, const Pred &pred) |
template<typename T , typename Pred > | |
PUGI_IMPL_FN void | partition3 (T *begin, T *end, T pivot, const Pred &pred, T **out_eqbeg, T **out_eqend) |
template<typename I , typename Pred > | |
PUGI_IMPL_FN void | sort (I begin, I end, const Pred &pred) |
PUGI_IMPL_FN bool | hash_insert (const void **table, size_t size, const void *key) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN bool | starts_with (const char_t *string, const char_t *pattern) |
PUGI_IMPL_FN const char_t * | find_char (const char_t *s, char_t c) |
PUGI_IMPL_FN const char_t * | find_substring (const char_t *s, const char_t *p) |
PUGI_IMPL_FN char_t | tolower_ascii (char_t ch) |
PUGI_IMPL_FN xpath_string | string_value (const xpath_node &na, xpath_allocator *alloc) |
PUGI_IMPL_FN bool | node_is_before_sibling (xml_node_struct *ln, xml_node_struct *rn) |
PUGI_IMPL_FN bool | node_is_before (xml_node_struct *ln, xml_node_struct *rn) |
PUGI_IMPL_FN bool | node_is_ancestor (xml_node_struct *parent, xml_node_struct *node) |
PUGI_IMPL_FN const void * | document_buffer_order (const xpath_node &xnode) |
PUGI_IMPL_FN double | gen_nan () |
PUGI_IMPL_FN bool | is_nan (double value) |
PUGI_IMPL_FN const char_t * | convert_number_to_string_special (double value) |
PUGI_IMPL_FN bool | convert_number_to_boolean (double value) |
PUGI_IMPL_FN void | truncate_zeros (char *begin, char *end) |
PUGI_IMPL_FN void | convert_number_to_mantissa_exponent (double value, char(&buffer)[32], char **out_mantissa, int *out_exponent) |
PUGI_IMPL_FN xpath_string | convert_number_to_string (double value, xpath_allocator *alloc) |
PUGI_IMPL_FN bool | check_string_to_number_format (const char_t *string) |
PUGI_IMPL_FN double | convert_string_to_number (const char_t *string) |
PUGI_IMPL_FN bool | convert_string_to_number_scratch (char_t(&buffer)[32], const char_t *begin, const char_t *end, double *out_result) |
PUGI_IMPL_FN double | round_nearest (double value) |
PUGI_IMPL_FN double | round_nearest_nzero (double value) |
PUGI_IMPL_FN const char_t * | qualified_name (const xpath_node &node) |
PUGI_IMPL_FN const char_t * | local_name (const xpath_node &node) |
PUGI_IMPL_FN const char_t * | namespace_uri (xml_node node) |
PUGI_IMPL_FN const char_t * | namespace_uri (xml_attribute attr, xml_node parent) |
PUGI_IMPL_FN const char_t * | namespace_uri (const xpath_node &node) |
PUGI_IMPL_FN char_t * | normalize_space (char_t *buffer) |
PUGI_IMPL_FN char_t * | translate (char_t *buffer, const char_t *from, const char_t *to, size_t to_length) |
PUGI_IMPL_FN unsigned char * | translate_table_generate (xpath_allocator *alloc, const char_t *from, const char_t *to) |
PUGI_IMPL_FN char_t * | translate_table (char_t *buffer, const unsigned char *table) |
bool | is_xpath_attribute (const char_t *name) |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW unsigned int | hash_string (const char_t *str) |
template<typename T > | |
PUGI_IMPL_FN T * | new_xpath_variable (const char_t *name) |
PUGI_IMPL_FN xpath_variable * | new_xpath_variable (xpath_value_type type, const char_t *name) |
template<typename T > | |
PUGI_IMPL_FN void | delete_xpath_variable (T *var) |
PUGI_IMPL_FN void | delete_xpath_variable (xpath_value_type type, xpath_variable *var) |
PUGI_IMPL_FN bool | copy_xpath_variable (xpath_variable *lhs, const xpath_variable *rhs) |
PUGI_IMPL_FN bool | get_variable_scratch (char_t(&buffer)[32], xpath_variable_set *set, const char_t *begin, const char_t *end, xpath_variable **out_result) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN xpath_node_set::type_t | xpath_get_order (const xpath_node *begin, const xpath_node *end) |
PUGI_IMPL_FN xpath_node_set::type_t | xpath_sort (xpath_node *begin, xpath_node *end, xpath_node_set::type_t type, bool rev) |
PUGI_IMPL_FN xpath_node | xpath_first (const xpath_node *begin, const xpath_node *end, xpath_node_set::type_t type) |
PUGI_IMPL_FN impl::xpath_ast_node * | evaluate_node_set_prepare (xpath_query_impl *impl) |
static PUGI_IMPL_FN void | pugi::unspecified_bool_xpath_node (xpath_node ***) |
static PUGI_IMPL_FN void | pugi::unspecified_bool_xpath_query (xpath_query ***) |
#define PUGI_IMPL_CHECK_ERROR | ( | err, | |
m | |||
) | { if (*s == 0) PUGI_IMPL_THROW_ERROR(err, m); } |
#define PUGI_IMPL_DMC_VOLATILE |
#define PUGI_IMPL_ENDSEG | ( | ) | { ch = *s; *s = 0; ++s; } |
#define PUGI_IMPL_ENDSWITH | ( | c, | |
e | |||
) | ((c) == (e) || ((c) == 0 && endch == (e))) |
#define PUGI_IMPL_FN |
#define PUGI_IMPL_FN_NO_INLINE PUGI_IMPL_NO_INLINE |
#define PUGI_IMPL_GETHEADER_IMPL | ( | object, | |
page, | |||
flags | |||
) | (((reinterpret_cast<char*>(object) - reinterpret_cast<char*>(page)) << 8) | (flags)) |
#define PUGI_IMPL_GETPAGE | ( | n | ) | PUGI_IMPL_GETPAGE_IMPL((n)->header) |
#define PUGI_IMPL_GETPAGE_IMPL | ( | header | ) | static_cast<impl::xml_memory_page*>(const_cast<void*>(static_cast<const void*>(reinterpret_cast<const char*>(&header) - (header >> 8)))) |
#define PUGI_IMPL_IS_CHARTYPE | ( | c, | |
ct | |||
) | PUGI_IMPL_IS_CHARTYPE_IMPL(c, ct, chartype_table) |
#define PUGI_IMPL_IS_CHARTYPE_IMPL | ( | c, | |
ct, | |||
table | |||
) | (table[static_cast<unsigned char>(c)] & (ct)) |
#define PUGI_IMPL_IS_CHARTYPEX | ( | c, | |
ct | |||
) | PUGI_IMPL_IS_CHARTYPE_IMPL(c, ct, chartypex_table) |
#define PUGI_IMPL_NO_INLINE |
#define PUGI_IMPL_NODETYPE | ( | n | ) | static_cast<xml_node_type>((n)->header & impl::xml_memory_page_type_mask) |
#define PUGI_IMPL_NS_BEGIN namespace pugi { namespace impl { namespace { |
#define PUGI_IMPL_NS_END } } } |
#define PUGI_IMPL_OPTSET | ( | OPT | ) | ( optmsk & (OPT) ) |
#define PUGI_IMPL_POPNODE | ( | ) | { cursor = cursor->parent; } |
#define PUGI_IMPL_PUSHNODE | ( | TYPE | ) | { cursor = append_new_node(cursor, *alloc, TYPE); if (!cursor) PUGI_IMPL_THROW_ERROR(status_out_of_memory, s); } |
#define PUGI_IMPL_SCANCHAR | ( | ch | ) | { if (offset >= size || data[offset] != ch) return false; offset++; } |
#define PUGI_IMPL_SCANCHARTYPE | ( | ct | ) | { while (offset < size && PUGI_IMPL_IS_CHARTYPE(data[offset], ct)) offset++; } |
#define PUGI_IMPL_SCANFOR | ( | X | ) | { while (*s != 0 && !(X)) ++s; } |
#define PUGI_IMPL_SCANWHILE | ( | X | ) | { while (X) ++s; } |
#define PUGI_IMPL_SCANWHILE_UNROLL | ( | X | ) | { for (;;) { char_t ss = s[0]; if (PUGI_IMPL_UNLIKELY(!(X))) { break; } ss = s[1]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 1; break; } ss = s[2]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 2; break; } ss = s[3]; if (PUGI_IMPL_UNLIKELY(!(X))) { s += 3; break; } s += 4; } } |
#define PUGI_IMPL_SKIPWS | ( | ) | { while (PUGI_IMPL_IS_CHARTYPE(*s, ct_space)) ++s; } |
#define PUGI_IMPL_SNPRINTF sprintf |
#define PUGI_IMPL_STATIC_ASSERT | ( | cond | ) | { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } |
#define PUGI_IMPL_THROW_ERROR | ( | err, | |
m | |||
) | return error_offset = m, error_status = err, static_cast<char_t*>(0) |
#define PUGI_IMPL_UNLIKELY | ( | cond | ) | (cond) |
#define PUGI_IMPL_UNSIGNED_OVERFLOW |
#define SOURCE_PUGIXML_CPP |
Copyright (C) 2006-2022, by Arseny Kapoulkine (arsen) Report bugs and download new versions at y.ka poulk ine@ gmail .comhttps://pugixml.org/
This library is distributed under the MIT License. See notice at the end of this file.
This work is based on the pugxml parser, which is: Copyright (C) 2003, by Kristen Wegner (krist) en@t ima.n et
typedef char_t*(* strconv_attribute_t) (char_t *, char_t) |
typedef char_t*(* strconv_pcdata_t) (char_t *) |
typedef wchar_selector<sizeof(wchar_t)>::counter wchar_counter |
typedef wchar_selector<sizeof(wchar_t)>::writer wchar_writer |
typedef xml_memory_management_function_storage<int> xml_memory |
enum ast_type_t |
enum axis_t |
enum chartype_t |
enum chartypex_t |
enum indent_flags_t |
enum lexeme_t |
enum nodeset_eval_t |
enum nodetest_t |
enum predicate_t |
|
inline |
|
inline |
PUGI_IMPL_FN bool allow_insert_attribute | ( | xml_node_type | parent | ) |
PUGI_IMPL_FN bool allow_insert_child | ( | xml_node_type | parent, |
xml_node_type | child | ||
) |
PUGI_IMPL_FN bool allow_move | ( | xml_node | parent, |
xml_node | child | ||
) |
|
inline |
PUGI_IMPL_FN_NO_INLINE xml_attribute_struct* append_new_attribute | ( | xml_node_struct * | node, |
xml_allocator & | alloc | ||
) |
PUGI_IMPL_FN_NO_INLINE xml_node_struct* append_new_node | ( | xml_node_struct * | node, |
xml_allocator & | alloc, | ||
xml_node_type | type = node_element |
||
) |
|
inline |
PUGI_IMPL_FN size_t as_utf8_begin | ( | const wchar_t * | str, |
size_t | length | ||
) |
PUGI_IMPL_FN void as_utf8_end | ( | char * | buffer, |
size_t | size, | ||
const wchar_t * | str, | ||
size_t | length | ||
) |
PUGI_IMPL_FN std::string as_utf8_impl | ( | const wchar_t * | str, |
size_t | length | ||
) |
PUGI_IMPL_FN std::basic_string<wchar_t> as_wide_impl | ( | const char * | str, |
size_t | size | ||
) |
PUGI_IMPL_FN bool check_string_to_number_format | ( | const char_t * | string | ) |
PUGI_IMPL_FN void close_file | ( | FILE * | file | ) |
PUGI_IMPL_FN bool convert_buffer | ( | char_t *& | out_buffer, |
size_t & | out_length, | ||
xml_encoding | encoding, | ||
const void * | contents, | ||
size_t | size, | ||
bool | is_mutable | ||
) |
PUGI_IMPL_FN bool convert_buffer_generic | ( | char_t *& | out_buffer, |
size_t & | out_length, | ||
const void * | contents, | ||
size_t | size, | ||
D | |||
) |
PUGI_IMPL_FN bool convert_buffer_latin1 | ( | char_t *& | out_buffer, |
size_t & | out_length, | ||
const void * | contents, | ||
size_t | size, | ||
bool | is_mutable | ||
) |
PUGI_IMPL_FN size_t convert_buffer_output | ( | char_t * | , |
uint8_t * | r_u8, | ||
uint16_t * | r_u16, | ||
uint32_t * | r_u32, | ||
const char_t * | data, | ||
size_t | length, | ||
xml_encoding | encoding | ||
) |
PUGI_IMPL_FN size_t convert_buffer_output_generic | ( | typename T::value_type | dest, |
const char_t * | data, | ||
size_t | length, | ||
D | , | ||
T | |||
) |
PUGI_IMPL_FN size_t convert_buffer_output_generic | ( | typename T::value_type | dest, |
const char_t * | data, | ||
size_t | length, | ||
D | , | ||
T | , | ||
bool | opt_swap | ||
) |
PUGI_IMPL_FN bool convert_number_to_boolean | ( | double | value | ) |
PUGI_IMPL_FN void convert_number_to_mantissa_exponent | ( | double | value, |
char(&) | buffer[32], | ||
char ** | out_mantissa, | ||
int * | out_exponent | ||
) |
PUGI_IMPL_FN xpath_string convert_number_to_string | ( | double | value, |
xpath_allocator * | alloc | ||
) |
PUGI_IMPL_FN const char_t* convert_number_to_string_special | ( | double | value | ) |
PUGI_IMPL_FN char* convert_path_heap | ( | const wchar_t * | str | ) |
PUGI_IMPL_FN double convert_string_to_number | ( | const char_t * | string | ) |
PUGI_IMPL_FN bool convert_string_to_number_scratch | ( | char_t(&) | buffer[32], |
const char_t * | begin, | ||
const char_t * | end, | ||
double * | out_result | ||
) |
PUGI_IMPL_FN bool copy_xpath_variable | ( | xpath_variable * | lhs, |
const xpath_variable * | rhs | ||
) |
PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN void* default_allocate | ( | size_t | size | ) |
PUGI_IMPL_FN void default_deallocate | ( | void * | ptr | ) |
PUGI_IMPL_FN void delete_xpath_variable | ( | T * | var | ) |
PUGI_IMPL_FN void delete_xpath_variable | ( | xpath_value_type | type, |
xpath_variable * | var | ||
) |
|
inline |
|
inline |
PUGI_IMPL_FN const void* document_buffer_order | ( | const xpath_node & | xnode | ) |
|
inline |
PUGI_IMPL_FN impl::xpath_ast_node* evaluate_node_set_prepare | ( | xpath_query_impl * | impl | ) |
PUGI_IMPL_FN const char_t* find_char | ( | const char_t * | s, |
char_t | c | ||
) |
PUGI_IMPL_FN const char_t* find_substring | ( | const char_t * | s, |
const char_t * | p | ||
) |
PUGI_IMPL_FN double gen_nan | ( | ) |
|
inline |
PUGI_IMPL_FN xml_encoding get_buffer_encoding | ( | xml_encoding | encoding, |
const void * | contents, | ||
size_t | size | ||
) |
|
inline |
PUGI_IMPL_FN xml_parse_status get_file_size | ( | FILE * | file, |
size_t & | out_result | ||
) |
PUGI_IMPL_FN size_t get_latin1_7bit_prefix_length | ( | const uint8_t * | data, |
size_t | size | ||
) |
PUGI_IMPL_FN bool get_mutable_buffer | ( | char_t *& | out_buffer, |
size_t & | out_length, | ||
const void * | contents, | ||
size_t | size, | ||
bool | is_mutable | ||
) |
PUGI_IMPL_FN strconv_attribute_t get_strconv_attribute | ( | unsigned int | optmask | ) |
PUGI_IMPL_FN strconv_pcdata_t get_strconv_pcdata | ( | unsigned int | optmask | ) |
PUGI_IMPL_FN size_t get_valid_length | ( | const char_t * | data, |
size_t | length | ||
) |
PUGI_IMPL_FN bool get_value_bool | ( | const char_t * | value | ) |
PUGI_IMPL_FN double get_value_double | ( | const char_t * | value | ) |
PUGI_IMPL_FN float get_value_float | ( | const char_t * | value | ) |
PUGI_IMPL_FN int get_value_int | ( | const char_t * | value | ) |
PUGI_IMPL_FN unsigned int get_value_uint | ( | const char_t * | value | ) |
PUGI_IMPL_FN bool get_variable_scratch | ( | char_t(&) | buffer[32], |
xpath_variable_set * | set, | ||
const char_t * | begin, | ||
const char_t * | end, | ||
xpath_variable ** | out_result | ||
) |
PUGI_IMPL_FN xml_encoding get_wchar_encoding | ( | ) |
PUGI_IMPL_FN xml_encoding get_write_encoding | ( | xml_encoding | encoding | ) |
PUGI_IMPL_FN xml_encoding get_write_native_encoding | ( | ) |
PUGI_IMPL_FN xml_encoding guess_buffer_encoding | ( | const uint8_t * | data, |
size_t | size | ||
) |
PUGI_IMPL_FN bool has_declaration | ( | xml_node_struct * | node | ) |
PUGI_IMPL_FN bool hash_insert | ( | const void ** | table, |
size_t | size, | ||
const void * | key | ||
) |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW unsigned int hash_string | ( | const char_t * | str | ) |
|
inline |
|
inline |
|
inline |
|
inline |
PUGI_IMPL_FN void insertion_sort | ( | T * | begin, |
T * | end, | ||
const Pred & | pred | ||
) |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW char_t* integer_to_string | ( | char_t * | begin, |
char_t * | end, | ||
U | value, | ||
bool | negative | ||
) |
PUGI_IMPL_FN bool is_attribute_of | ( | xml_attribute_struct * | attr, |
xml_node_struct * | node | ||
) |
PUGI_IMPL_FN bool is_little_endian | ( | ) |
PUGI_IMPL_FN bool is_nan | ( | double | value | ) |
|
inline |
|
inline |
PUGI_IMPL_FN xml_parse_result load_buffer_impl | ( | xml_document_struct * | doc, |
xml_node_struct * | root, | ||
void * | contents, | ||
size_t | size, | ||
unsigned int | options, | ||
xml_encoding | encoding, | ||
bool | is_mutable, | ||
bool | own, | ||
char_t ** | out_buffer | ||
) |
PUGI_IMPL_FN xml_parse_result load_file_impl | ( | xml_document_struct * | doc, |
FILE * | file, | ||
unsigned int | options, | ||
xml_encoding | encoding, | ||
char_t ** | out_buffer | ||
) |
PUGI_IMPL_FN xml_parse_status load_stream_data_noseek | ( | std::basic_istream< T > & | stream, |
void ** | out_buffer, | ||
size_t * | out_size | ||
) |
PUGI_IMPL_FN xml_parse_status load_stream_data_seek | ( | std::basic_istream< T > & | stream, |
void ** | out_buffer, | ||
size_t * | out_size | ||
) |
PUGI_IMPL_FN xml_parse_result load_stream_impl | ( | xml_document_struct * | doc, |
std::basic_istream< T > & | stream, | ||
unsigned int | options, | ||
xml_encoding | encoding, | ||
char_t ** | out_buffer | ||
) |
PUGI_IMPL_FN const char_t* local_name | ( | const xpath_node & | node | ) |
|
inline |
|
inline |
PUGI_IMPL_FN I min_element | ( | I | begin, |
I | end, | ||
const Pred & | pred | ||
) |
PUGI_IMPL_FN const char_t* namespace_uri | ( | const xpath_node & | node | ) |
PUGI_IMPL_FN const char_t* namespace_uri | ( | xml_attribute | attr, |
xml_node | parent | ||
) |
PUGI_IMPL_FN const char_t* namespace_uri | ( | xml_node | node | ) |
PUGI_IMPL_FN T* new_xpath_variable | ( | const char_t * | name | ) |
PUGI_IMPL_FN xpath_variable* new_xpath_variable | ( | xpath_value_type | type, |
const char_t * | name | ||
) |
PUGI_IMPL_FN void node_copy_attribute | ( | xml_attribute_struct * | da, |
xml_attribute_struct * | sa | ||
) |
PUGI_IMPL_FN void node_copy_contents | ( | xml_node_struct * | dn, |
xml_node_struct * | sn, | ||
xml_allocator * | shared_alloc | ||
) |
PUGI_IMPL_FN void node_copy_string | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
char_t * | source, | ||
Header & | source_header, | ||
xml_allocator * | alloc | ||
) |
PUGI_IMPL_FN void node_copy_tree | ( | xml_node_struct * | dn, |
xml_node_struct * | sn | ||
) |
PUGI_IMPL_FN bool node_is_ancestor | ( | xml_node_struct * | parent, |
xml_node_struct * | node | ||
) |
PUGI_IMPL_FN bool node_is_before | ( | xml_node_struct * | ln, |
xml_node_struct * | rn | ||
) |
PUGI_IMPL_FN bool node_is_before_sibling | ( | xml_node_struct * | ln, |
xml_node_struct * | rn | ||
) |
PUGI_IMPL_FN void node_output | ( | xml_buffered_writer & | writer, |
xml_node_struct * | root, | ||
const char_t * | indent, | ||
unsigned int | flags, | ||
unsigned int | depth | ||
) |
PUGI_IMPL_FN void node_output_attributes | ( | xml_buffered_writer & | writer, |
xml_node_struct * | node, | ||
const char_t * | indent, | ||
size_t | indent_length, | ||
unsigned int | flags, | ||
unsigned int | depth | ||
) |
PUGI_IMPL_FN void node_output_comment | ( | xml_buffered_writer & | writer, |
const char_t * | s | ||
) |
PUGI_IMPL_FN void node_output_end | ( | xml_buffered_writer & | writer, |
xml_node_struct * | node | ||
) |
PUGI_IMPL_FN void node_output_pi_value | ( | xml_buffered_writer & | writer, |
const char_t * | s | ||
) |
PUGI_IMPL_FN void node_output_simple | ( | xml_buffered_writer & | writer, |
xml_node_struct * | node, | ||
unsigned int | flags | ||
) |
PUGI_IMPL_FN bool node_output_start | ( | xml_buffered_writer & | writer, |
xml_node_struct * | node, | ||
const char_t * | indent, | ||
size_t | indent_length, | ||
unsigned int | flags, | ||
unsigned int | depth | ||
) |
PUGI_IMPL_FN char_t* normalize_space | ( | char_t * | buffer | ) |
PUGI_IMPL_FN FILE* open_file | ( | const char * | path, |
const char * | mode | ||
) |
PUGI_IMPL_FN FILE* open_file_wide | ( | const wchar_t * | path, |
const wchar_t * | mode | ||
) |
PUGI_IMPL_FN bool parse_declaration_encoding | ( | const uint8_t * | data, |
size_t | size, | ||
const uint8_t *& | out_encoding, | ||
size_t & | out_length | ||
) |
PUGI_IMPL_FN void partition3 | ( | T * | begin, |
T * | end, | ||
T | pivot, | ||
const Pred & | pred, | ||
T ** | out_eqbeg, | ||
T ** | out_eqend | ||
) |
|
inline |
|
inline |
PUGI_IMPL_FN const char_t* qualified_name | ( | const xpath_node & | node | ) |
|
inline |
|
inline |
PUGI_IMPL_FN void reverse | ( | I | begin, |
I | end | ||
) |
PUGI_IMPL_FN double round_nearest | ( | double | value | ) |
PUGI_IMPL_FN double round_nearest_nzero | ( | double | value | ) |
PUGI_IMPL_FN bool save_file_impl | ( | const xml_document & | doc, |
FILE * | file, | ||
const char_t * | indent, | ||
unsigned int | flags, | ||
xml_encoding | encoding | ||
) |
PUGI_IMPL_FN bool set_value_ascii | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
char * | buf | ||
) |
PUGI_IMPL_FN bool set_value_bool | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
bool | value | ||
) |
PUGI_IMPL_FN bool set_value_convert | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
double | value, | ||
int | precision | ||
) |
PUGI_IMPL_FN bool set_value_convert | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
float | value, | ||
int | precision | ||
) |
PUGI_IMPL_FN bool set_value_integer | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
U | value, | ||
bool | negative | ||
) |
PUGI_IMPL_FN void sort | ( | I | begin, |
I | end, | ||
const Pred & | pred | ||
) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN bool starts_with | ( | const char_t * | string, |
const char_t * | pattern | ||
) |
PUGI_IMPL_FN char_t* strconv_cdata | ( | char_t * | s, |
char_t | endch | ||
) |
PUGI_IMPL_FN char_t* strconv_comment | ( | char_t * | s, |
char_t | endch | ||
) |
PUGI_IMPL_FN char_t* strconv_escape | ( | char_t * | s, |
gap & | g | ||
) |
PUGI_IMPL_FN bool strcpy_insitu | ( | String & | dest, |
Header & | header, | ||
uintptr_t | header_mask, | ||
const char_t * | source, | ||
size_t | source_length | ||
) |
|
inline |
PUGI_IMPL_FN bool strequal | ( | const char_t * | src, |
const char_t * | dst | ||
) |
PUGI_IMPL_FN bool strequalrange | ( | const char_t * | lhs, |
const char_t * | rhs, | ||
size_t | count | ||
) |
PUGI_IMPL_FN PUGI_IMPL_UNSIGNED_OVERFLOW U string_to_integer | ( | const char_t * | value, |
U | minv, | ||
U | maxv | ||
) |
PUGI_IMPL_FN xpath_string string_value | ( | const xpath_node & | na, |
xpath_allocator * | alloc | ||
) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN size_t strlength | ( | const char_t * | s | ) |
PUGI_IMPL_FN size_t strlength_wide | ( | const wchar_t * | s | ) |
|
inline |
PUGI_IMPL_FN void text_output | ( | xml_buffered_writer & | writer, |
const char_t * | s, | ||
chartypex_t | type, | ||
unsigned int | flags | ||
) |
PUGI_IMPL_FN void text_output_cdata | ( | xml_buffered_writer & | writer, |
const char_t * | s | ||
) |
PUGI_IMPL_FN void text_output_escaped | ( | xml_buffered_writer & | writer, |
const char_t * | s, | ||
chartypex_t | type, | ||
unsigned int | flags | ||
) |
PUGI_IMPL_FN void text_output_indent | ( | xml_buffered_writer & | writer, |
const char_t * | indent, | ||
size_t | indent_length, | ||
unsigned int | depth | ||
) |
PUGI_IMPL_FN char_t tolower_ascii | ( | char_t | ch | ) |
PUGI_IMPL_FN char_t* translate | ( | char_t * | buffer, |
const char_t * | from, | ||
const char_t * | to, | ||
size_t | to_length | ||
) |
PUGI_IMPL_FN char_t* translate_table | ( | char_t * | buffer, |
const unsigned char * | table | ||
) |
PUGI_IMPL_FN unsigned char* translate_table_generate | ( | xpath_allocator * | alloc, |
const char_t * | from, | ||
const char_t * | to | ||
) |
PUGI_IMPL_FN void truncate_zeros | ( | char * | begin, |
char * | end | ||
) |
PUGI_IMPL_FN I unique | ( | I | begin, |
I | end | ||
) |
PUGI_IMPL_FN xpath_node xpath_first | ( | const xpath_node * | begin, |
const xpath_node * | end, | ||
xpath_node_set::type_t | type | ||
) |
PUGI_IMPL_NS_END PUGI_IMPL_NS_BEGIN PUGI_IMPL_FN xpath_node_set::type_t xpath_get_order | ( | const xpath_node * | begin, |
const xpath_node * | end | ||
) |
PUGI_IMPL_FN xpath_node_set::type_t xpath_sort | ( | xpath_node * | begin, |
xpath_node * | end, | ||
xpath_node_set::type_t | type, | ||
bool | rev | ||
) |
PUGI_IMPL_FN size_t zero_terminate_buffer | ( | void * | buffer, |
size_t | size, | ||
xml_encoding | encoding | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |