Created
March 8, 2012 06:41
-
-
Save zeux/1999235 to your computer and use it in GitHub Desktop.
pugixml header mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13a14,16 | |
> #ifndef SOURCE_PUGIXML_CPP | |
> #define SOURCE_PUGIXML_CPP | |
> | |
39a43 | |
> # pragma warning(push) | |
48a53 | |
> # pragma warning(push) | |
55a61 | |
> # pragma option push | |
60a67 | |
> # pragma diag_push | |
65,79d71 | |
< // uintptr_t | |
< #if !defined(_MSC_VER) || _MSC_VER >= 1600 | |
< # include <stdint.h> | |
< #else | |
< # ifndef _UINTPTR_T_DEFINED | |
< // No native uintptr_t in MSVC6 and in some WinCE versions | |
< typedef size_t uintptr_t; | |
< #define _UINTPTR_T_DEFINED | |
< # endif | |
< typedef unsigned __int8 uint8_t; | |
< typedef unsigned __int16 uint16_t; | |
< typedef unsigned __int32 uint32_t; | |
< typedef __int32 int32_t; | |
< #endif | |
< | |
82c74 | |
< # define PUGIXML_NO_INLINE __declspec(noinline) | |
--- | |
> # define PUGI__NO_INLINE __declspec(noinline) | |
84c76 | |
< # define PUGIXML_NO_INLINE __attribute__((noinline)) | |
--- | |
> # define PUGI__NO_INLINE __attribute__((noinline)) | |
86c78 | |
< # define PUGIXML_NO_INLINE | |
--- | |
> # define PUGI__NO_INLINE | |
90c82 | |
< #define STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } | |
--- | |
> #define PUGI__STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } | |
94c86 | |
< # define DMC_VOLATILE volatile | |
--- | |
> # define PUGI__DMC_VOLATILE volatile | |
96c88 | |
< # define DMC_VOLATILE | |
--- | |
> # define PUGI__DMC_VOLATILE | |
101c93,103 | |
< # define MSVC_CRT_VERSION _MSC_VER | |
--- | |
> # define PUGI__MSVC_CRT_VERSION _MSC_VER | |
> #endif | |
> | |
> #ifdef PUGIXML_HEADER_ONLY | |
> # define PUGI__NS pugiimpl | |
> # define PUGI__NSQ pugiimpl:: | |
> # define PUGI__FN inline | |
> #else | |
> # define PUGI__NS | |
> # define PUGI__NSQ | |
> # define PUGI__FN | |
104c106,127 | |
< using namespace pugi; | |
--- | |
> // uintptr_t | |
> #if !defined(_MSC_VER) || _MSC_VER >= 1600 | |
> # include <stdint.h> | |
> #else | |
> # ifndef _UINTPTR_T_DEFINED | |
> // No native uintptr_t in MSVC6 and in some WinCE versions | |
> typedef size_t uintptr_t; | |
> #define _UINTPTR_T_DEFINED | |
> # endif | |
> namespace PUGI__NS | |
> { | |
> typedef unsigned __int8 uint8_t; | |
> typedef unsigned __int16 uint16_t; | |
> typedef unsigned __int32 uint32_t; | |
> typedef __int32 int32_t; | |
> } | |
> #endif | |
> | |
> namespace PUGI__NS | |
> { | |
> using namespace pugi; | |
> } | |
107c130 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
109c132 | |
< void* default_allocate(size_t size) | |
--- | |
> PUGI__FN void* default_allocate(size_t size) | |
114c137 | |
< void default_deallocate(void* ptr) | |
--- | |
> PUGI__FN void default_deallocate(void* ptr) | |
119,120c142,152 | |
< allocation_function global_allocate = default_allocate; | |
< deallocation_function global_deallocate = default_deallocate; | |
--- | |
> template <typename T> | |
> struct xml_memory_management_function_storage | |
> { | |
> static allocation_function allocate; | |
> static deallocation_function deallocate; | |
> }; | |
> | |
> template <typename T> allocation_function xml_memory_management_function_storage<T>::allocate = default_allocate; | |
> template <typename T> deallocation_function xml_memory_management_function_storage<T>::deallocate = default_deallocate; | |
> | |
> typedef xml_memory_management_function_storage<int> xml_memory; | |
124c156 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
127c159 | |
< size_t strlength(const char_t* s) | |
--- | |
> PUGI__FN size_t strlength(const char_t* s) | |
139c171 | |
< bool strequal(const char_t* src, const char_t* dst) | |
--- | |
> PUGI__FN bool strequal(const char_t* src, const char_t* dst) | |
151c183 | |
< bool strequalrange(const char_t* lhs, const char_t* rhs, size_t count) | |
--- | |
> PUGI__FN bool strequalrange(const char_t* lhs, const char_t* rhs, size_t count) | |
162c194 | |
< void widen_ascii(wchar_t* dest, const char* source) | |
--- | |
> PUGI__FN void widen_ascii(wchar_t* dest, const char* source) | |
172c204 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
198c230 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
258c290 | |
< void* memory = global_allocate(size + xml_memory_page_alignment); | |
--- | |
> void* memory = xml_memory::allocate(size + xml_memory_page_alignment); | |
275c307 | |
< global_deallocate(page->memory); | |
--- | |
> xml_memory::deallocate(page->memory); | |
378c410 | |
< PUGIXML_NO_INLINE void* xml_allocator::allocate_memory_oob(size_t size, xml_memory_page*& out_page) | |
--- | |
> PUGI__FN PUGI__NO_INLINE void* xml_allocator::allocate_memory_oob(size_t size, xml_memory_page*& out_page) | |
423c455 | |
< xml_attribute_struct(xml_memory_page* page): header(reinterpret_cast<uintptr_t>(page)), name(0), value(0), prev_attribute_c(0), next_attribute(0) | |
--- | |
> xml_attribute_struct(PUGI__NSQ xml_memory_page* page): header(reinterpret_cast<uintptr_t>(page)), name(0), value(0), prev_attribute_c(0), next_attribute(0) | |
441c473 | |
< xml_node_struct(xml_memory_page* page, xml_node_type type): header(reinterpret_cast<uintptr_t>(page) | (type - 1)), parent(0), name(0), value(0), first_child(0), prev_sibling_c(0), next_sibling(0), first_attribute(0) | |
--- | |
> xml_node_struct(PUGI__NSQ xml_memory_page* page, xml_node_type type): header(reinterpret_cast<uintptr_t>(page) | (type - 1)), parent(0), name(0), value(0), first_child(0), prev_sibling_c(0), next_sibling(0), first_attribute(0) | |
461c493 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
472c504 | |
< static inline xml_allocator& get_allocator(const xml_node_struct* node) | |
--- | |
> inline xml_allocator& get_allocator(const xml_node_struct* node) | |
481c513 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
503,504c535,536 | |
< if (header & xml_memory_page_name_allocated_mask) alloc.deallocate_string(a->name); | |
< if (header & xml_memory_page_value_allocated_mask) alloc.deallocate_string(a->value); | |
--- | |
> if (header & PUGI__NSQ xml_memory_page_name_allocated_mask) alloc.deallocate_string(a->name); | |
> if (header & PUGI__NSQ xml_memory_page_value_allocated_mask) alloc.deallocate_string(a->value); | |
513,514c545,546 | |
< if (header & xml_memory_page_name_allocated_mask) alloc.deallocate_string(n->name); | |
< if (header & xml_memory_page_value_allocated_mask) alloc.deallocate_string(n->value); | |
--- | |
> if (header & PUGI__NSQ xml_memory_page_name_allocated_mask) alloc.deallocate_string(n->name); | |
> if (header & PUGI__NSQ xml_memory_page_value_allocated_mask) alloc.deallocate_string(n->value); | |
537c569 | |
< PUGIXML_NO_INLINE xml_node_struct* append_node(xml_node_struct* node, xml_allocator& alloc, xml_node_type type = node_element) | |
--- | |
> PUGI__FN PUGI__NO_INLINE xml_node_struct* append_node(xml_node_struct* node, xml_allocator& alloc, xml_node_type type = node_element) | |
563c595 | |
< PUGIXML_NO_INLINE xml_attribute_struct* append_attribute_ll(xml_node_struct* node, xml_allocator& alloc) | |
--- | |
> PUGI__FN PUGI__NO_INLINE xml_attribute_struct* append_attribute_ll(xml_node_struct* node, xml_allocator& alloc) | |
589c621 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
603c635 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
964c996 | |
< template <typename T> inline void convert_utf_endian_swap(T* result, const T* data, size_t length) | |
--- | |
> template <typename T> PUGI__FN void convert_utf_endian_swap(T* result, const T* data, size_t length) | |
970c1002 | |
< inline void convert_wchar_endian_swap(wchar_t* result, const wchar_t* data, size_t length) | |
--- | |
> PUGI__FN void convert_wchar_endian_swap(wchar_t* result, const wchar_t* data, size_t length) | |
977,978c1009,1010 | |
< namespace | |
< { | |
--- | |
> namespace PUGI__NS | |
> { | |
1044c1076 | |
< #define IS_CHARTYPE_IMPL(c, ct, table) ((static_cast<unsigned int>(c) < 128 ? table[static_cast<unsigned int>(c)] : table[128]) & (ct)) | |
--- | |
> #define PUGI__IS_CHARTYPE_IMPL(c, ct, table) ((static_cast<unsigned int>(c) < 128 ? table[static_cast<unsigned int>(c)] : table[128]) & (ct)) | |
1046c1078 | |
< #define IS_CHARTYPE_IMPL(c, ct, table) (table[static_cast<unsigned char>(c)] & (ct)) | |
--- | |
> #define PUGI__IS_CHARTYPE_IMPL(c, ct, table) (table[static_cast<unsigned char>(c)] & (ct)) | |
1049,1050c1081,1082 | |
< #define IS_CHARTYPE(c, ct) IS_CHARTYPE_IMPL(c, ct, chartype_table) | |
< #define IS_CHARTYPEX(c, ct) IS_CHARTYPE_IMPL(c, ct, chartypex_table) | |
--- | |
> #define PUGI__IS_CHARTYPE(c, ct) PUGI__IS_CHARTYPE_IMPL(c, ct, chartype_table) | |
> #define PUGI__IS_CHARTYPEX(c, ct) PUGI__IS_CHARTYPE_IMPL(c, ct, chartypex_table) | |
1052c1084 | |
< bool is_little_endian() | |
--- | |
> PUGI__FN bool is_little_endian() | |
1059c1091 | |
< xml_encoding get_wchar_encoding() | |
--- | |
> PUGI__FN xml_encoding get_wchar_encoding() | |
1061c1093 | |
< STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4); | |
--- | |
> PUGI__STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4); | |
1069c1101 | |
< xml_encoding guess_buffer_encoding(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) | |
--- | |
> PUGI__FN xml_encoding guess_buffer_encoding(uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3) | |
1093c1125 | |
< xml_encoding get_buffer_encoding(xml_encoding encoding, const void* contents, size_t size) | |
--- | |
> PUGI__FN xml_encoding get_buffer_encoding(xml_encoding encoding, const void* contents, size_t size) | |
1113c1145 | |
< DMC_VOLATILE uint8_t d0 = data[0], d1 = data[1], d2 = data[2], d3 = data[3]; | |
--- | |
> PUGI__DMC_VOLATILE uint8_t d0 = data[0], d1 = data[1], d2 = data[2], d3 = data[3]; | |
1118c1150 | |
< bool get_mutable_buffer(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
--- | |
> PUGI__FN bool get_mutable_buffer(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
1126c1158 | |
< void* buffer = global_allocate(size > 0 ? size : 1); | |
--- | |
> void* buffer = xml_memory::allocate(size > 0 ? size : 1); | |
1140c1172 | |
< inline bool need_endian_swap_utf(xml_encoding le, xml_encoding re) | |
--- | |
> PUGI__FN bool need_endian_swap_utf(xml_encoding le, xml_encoding re) | |
1146c1178 | |
< bool convert_buffer_endian_swap(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
--- | |
> PUGI__FN bool convert_buffer_endian_swap(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
1156c1188 | |
< out_buffer = static_cast<char_t*>(global_allocate(size > 0 ? size : 1)); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate(size > 0 ? size : 1)); | |
1167c1199 | |
< bool convert_buffer_utf8(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) | |
--- | |
> PUGI__FN bool convert_buffer_utf8(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) | |
1175c1207 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1188c1220 | |
< template <typename opt_swap> bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
--- | |
> template <typename opt_swap> PUGI__FN bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
1197c1229 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1210c1242 | |
< template <typename opt_swap> bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
--- | |
> template <typename opt_swap> PUGI__FN bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
1219c1251 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1232c1264 | |
< bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) | |
--- | |
> PUGI__FN bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size) | |
1240c1272 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1253c1285 | |
< bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) | |
--- | |
> PUGI__FN bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) | |
1294c1326 | |
< template <typename opt_swap> bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
--- | |
> template <typename opt_swap> PUGI__FN bool convert_buffer_utf16(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
1303c1335 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1316c1348 | |
< template <typename opt_swap> bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
--- | |
> template <typename opt_swap> PUGI__FN bool convert_buffer_utf32(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, opt_swap) | |
1325c1357 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1338c1370 | |
< size_t get_latin1_7bit_prefix_length(const uint8_t* data, size_t size) | |
--- | |
> PUGI__FN size_t get_latin1_7bit_prefix_length(const uint8_t* data, size_t size) | |
1347c1379 | |
< bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
--- | |
> PUGI__FN bool convert_buffer_latin1(char_t*& out_buffer, size_t& out_length, const void* contents, size_t size, bool is_mutable) | |
1365c1397 | |
< out_buffer = static_cast<char_t*>(global_allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
--- | |
> out_buffer = static_cast<char_t*>(xml_memory::allocate((out_length > 0 ? out_length : 1) * sizeof(char_t))); | |
1380c1412 | |
< bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) | |
--- | |
> PUGI__FN bool convert_buffer(char_t*& out_buffer, size_t& out_length, xml_encoding encoding, const void* contents, size_t size, bool is_mutable) | |
1413c1445 | |
< size_t as_utf8_begin(const wchar_t* str, size_t length) | |
--- | |
> PUGI__FN size_t as_utf8_begin(const wchar_t* str, size_t length) | |
1419c1451 | |
< void as_utf8_end(char* buffer, size_t size, const wchar_t* str, size_t length) | |
--- | |
> PUGI__FN void as_utf8_end(char* buffer, size_t size, const wchar_t* str, size_t length) | |
1433c1465 | |
< std::string as_utf8_impl(const wchar_t* str, size_t length) | |
--- | |
> PUGI__FN std::string as_utf8_impl(const wchar_t* str, size_t length) | |
1448c1480 | |
< std::basic_string<wchar_t> as_wide_impl(const char* str, size_t size) | |
--- | |
> PUGI__FN std::basic_string<wchar_t> as_wide_impl(const char* str, size_t size) | |
1487c1519 | |
< bool strcpy_insitu(char_t*& dest, uintptr_t& header, uintptr_t header_mask, const char_t* source) | |
--- | |
> PUGI__FN bool strcpy_insitu(char_t*& dest, uintptr_t& header, uintptr_t header_mask, const char_t* source) | |
1575c1607 | |
< char_t* strconv_escape(char_t* s, gap& g) | |
--- | |
> PUGI__FN char_t* strconv_escape(char_t* s, gap& g) | |
1718c1750 | |
< char_t* strconv_comment(char_t* s, char_t endch) | |
--- | |
> PUGI__FN char_t* strconv_comment(char_t* s, char_t endch) | |
1724c1756 | |
< while (!IS_CHARTYPE(*s, ct_parse_comment)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_comment)) ++s; | |
1746c1778 | |
< char_t* strconv_cdata(char_t* s, char_t endch) | |
--- | |
> PUGI__FN char_t* strconv_cdata(char_t* s, char_t endch) | |
1752c1784 | |
< while (!IS_CHARTYPE(*s, ct_parse_cdata)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_cdata)) ++s; | |
1784c1816 | |
< while (!IS_CHARTYPE(*s, ct_parse_pcdata)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_pcdata)) ++s; | |
1811c1843 | |
< strconv_pcdata_t get_strconv_pcdata(unsigned int optmask) | |
--- | |
> PUGI__FN strconv_pcdata_t get_strconv_pcdata(unsigned int optmask) | |
1813c1845 | |
< STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20); | |
--- | |
> PUGI__STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20); | |
1834c1866 | |
< if (IS_CHARTYPE(*s, ct_space)) | |
--- | |
> if (PUGI__IS_CHARTYPE(*s, ct_space)) | |
1839c1871 | |
< while (IS_CHARTYPE(*str, ct_space)); | |
--- | |
> while (PUGI__IS_CHARTYPE(*str, ct_space)); | |
1846c1878 | |
< while (!IS_CHARTYPE(*s, ct_parse_attr_ws | ct_space)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws | ct_space)) ++s; | |
1853c1885 | |
< while (IS_CHARTYPE(*str, ct_space)); | |
--- | |
> while (PUGI__IS_CHARTYPE(*str, ct_space)); | |
1857c1889 | |
< else if (IS_CHARTYPE(*s, ct_space)) | |
--- | |
> else if (PUGI__IS_CHARTYPE(*s, ct_space)) | |
1861c1893 | |
< if (IS_CHARTYPE(*s, ct_space)) | |
--- | |
> if (PUGI__IS_CHARTYPE(*s, ct_space)) | |
1864c1896 | |
< while (IS_CHARTYPE(*str, ct_space)) ++str; | |
--- | |
> while (PUGI__IS_CHARTYPE(*str, ct_space)) ++str; | |
1887c1919 | |
< while (!IS_CHARTYPE(*s, ct_parse_attr_ws)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr_ws)) ++s; | |
1895c1927 | |
< else if (IS_CHARTYPE(*s, ct_space)) | |
--- | |
> else if (PUGI__IS_CHARTYPE(*s, ct_space)) | |
1923c1955 | |
< while (!IS_CHARTYPE(*s, ct_parse_attr)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr)) ++s; | |
1955c1987 | |
< while (!IS_CHARTYPE(*s, ct_parse_attr)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPE(*s, ct_parse_attr)) ++s; | |
1976c2008 | |
< strconv_attribute_t get_strconv_attribute(unsigned int optmask) | |
--- | |
> PUGI__FN strconv_attribute_t get_strconv_attribute(unsigned int optmask) | |
1978c2010 | |
< STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_wconv_attribute == 0x40 && parse_wnorm_attribute == 0x80); | |
--- | |
> PUGI__STATIC_ASSERT(parse_escapes == 0x10 && parse_eol == 0x20 && parse_wconv_attribute == 0x40 && parse_wnorm_attribute == 0x80); | |
2018,2026c2050,2058 | |
< #define SKIPWS() { while (IS_CHARTYPE(*s, ct_space)) ++s; } | |
< #define OPTSET(OPT) ( optmsk & (OPT) ) | |
< #define PUSHNODE(TYPE) { cursor = append_node(cursor, alloc, TYPE); if (!cursor) THROW_ERROR(status_out_of_memory, s); } | |
< #define POPNODE() { cursor = cursor->parent; } | |
< #define SCANFOR(X) { while (*s != 0 && !(X)) ++s; } | |
< #define SCANWHILE(X) { while ((X)) ++s; } | |
< #define ENDSEG() { ch = *s; *s = 0; ++s; } | |
< #define THROW_ERROR(err, m) return error_offset = m, error_status = err, static_cast<char_t*>(0) | |
< #define CHECK_ERROR(err, m) { if (*s == 0) THROW_ERROR(err, m); } | |
--- | |
> #define PUGI__SKIPWS() { while (PUGI__IS_CHARTYPE(*s, ct_space)) ++s; } | |
> #define PUGI__OPTSET(OPT) ( optmsk & (OPT) ) | |
> #define PUGI__PUSHNODE(TYPE) { cursor = append_node(cursor, alloc, TYPE); if (!cursor) PUGI__THROW_ERROR(status_out_of_memory, s); } | |
> #define PUGI__POPNODE() { cursor = cursor->parent; } | |
> #define PUGI__SCANFOR(X) { while (*s != 0 && !(X)) ++s; } | |
> #define PUGI__SCANWHILE(X) { while ((X)) ++s; } | |
> #define PUGI__ENDSEG() { ch = *s; *s = 0; ++s; } | |
> #define PUGI__THROW_ERROR(err, m) return error_offset = m, error_status = err, static_cast<char_t*>(0) | |
> #define PUGI__CHECK_ERROR(err, m) { if (*s == 0) PUGI__THROW_ERROR(err, m); } | |
2045,2046c2077,2078 | |
< SCANFOR(*s == ch); | |
< if (!*s) THROW_ERROR(status_bad_doctype, s); | |
--- | |
> PUGI__SCANFOR(*s == ch); | |
> if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); | |
2054,2055c2086,2087 | |
< SCANFOR(s[0] == '?' && s[1] == '>'); // no need for ENDSWITH because ?> can't terminate proper doctype | |
< if (!*s) THROW_ERROR(status_bad_doctype, s); | |
--- | |
> PUGI__SCANFOR(s[0] == '?' && s[1] == '>'); // no need for ENDSWITH because ?> can't terminate proper doctype | |
> if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); | |
2062,2063c2094,2095 | |
< SCANFOR(s[0] == '-' && s[1] == '-' && s[2] == '>'); // no need for ENDSWITH because --> can't terminate proper doctype | |
< if (!*s) THROW_ERROR(status_bad_doctype, s); | |
--- | |
> PUGI__SCANFOR(s[0] == '-' && s[1] == '-' && s[2] == '>'); // no need for ENDSWITH because --> can't terminate proper doctype | |
> if (!*s) PUGI__THROW_ERROR(status_bad_doctype, s); | |
2067c2099 | |
< else THROW_ERROR(status_bad_doctype, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_doctype, s); | |
2095c2127 | |
< THROW_ERROR(status_bad_doctype, s); | |
--- | |
> PUGI__THROW_ERROR(status_bad_doctype, s); | |
2135c2167 | |
< if (!toplevel || endch != '>') THROW_ERROR(status_bad_doctype, s); | |
--- | |
> if (!toplevel || endch != '>') PUGI__THROW_ERROR(status_bad_doctype, s); | |
2153c2185 | |
< if (OPTSET(parse_comments)) | |
--- | |
> if (PUGI__OPTSET(parse_comments)) | |
2155c2187 | |
< PUSHNODE(node_comment); // Append a new node on the tree. | |
--- | |
> PUGI__PUSHNODE(node_comment); // Append a new node on the tree. | |
2159c2191 | |
< if (OPTSET(parse_eol) && OPTSET(parse_comments)) | |
--- | |
> if (PUGI__OPTSET(parse_eol) && PUGI__OPTSET(parse_comments)) | |
2163c2195 | |
< if (!s) THROW_ERROR(status_bad_comment, cursor->value); | |
--- | |
> if (!s) PUGI__THROW_ERROR(status_bad_comment, cursor->value); | |
2168,2169c2200,2201 | |
< SCANFOR(s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')); | |
< CHECK_ERROR(status_bad_comment, s); | |
--- | |
> PUGI__SCANFOR(s[0] == '-' && s[1] == '-' && ENDSWITH(s[2], '>')); | |
> PUGI__CHECK_ERROR(status_bad_comment, s); | |
2171c2203 | |
< if (OPTSET(parse_comments)) | |
--- | |
> if (PUGI__OPTSET(parse_comments)) | |
2177c2209 | |
< else THROW_ERROR(status_bad_comment, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_comment, s); | |
2186c2218 | |
< if (OPTSET(parse_cdata)) | |
--- | |
> if (PUGI__OPTSET(parse_cdata)) | |
2188c2220 | |
< PUSHNODE(node_cdata); // Append a new node on the tree. | |
--- | |
> PUGI__PUSHNODE(node_cdata); // Append a new node on the tree. | |
2191c2223 | |
< if (OPTSET(parse_eol)) | |
--- | |
> if (PUGI__OPTSET(parse_eol)) | |
2195c2227 | |
< if (!s) THROW_ERROR(status_bad_cdata, cursor->value); | |
--- | |
> if (!s) PUGI__THROW_ERROR(status_bad_cdata, cursor->value); | |
2200,2201c2232,2233 | |
< SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); | |
< CHECK_ERROR(status_bad_cdata, s); | |
--- | |
> PUGI__SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); | |
> PUGI__CHECK_ERROR(status_bad_cdata, s); | |
2209,2210c2241,2242 | |
< SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); | |
< CHECK_ERROR(status_bad_cdata, s); | |
--- | |
> PUGI__SCANFOR(s[0] == ']' && s[1] == ']' && ENDSWITH(s[2], '>')); | |
> PUGI__CHECK_ERROR(status_bad_cdata, s); | |
2217c2249 | |
< else THROW_ERROR(status_bad_cdata, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_cdata, s); | |
2223c2255 | |
< if (cursor->parent) THROW_ERROR(status_bad_doctype, s); | |
--- | |
> if (cursor->parent) PUGI__THROW_ERROR(status_bad_doctype, s); | |
2230c2262 | |
< if (OPTSET(parse_doctype)) | |
--- | |
> if (PUGI__OPTSET(parse_doctype)) | |
2232c2264 | |
< while (IS_CHARTYPE(*mark, ct_space)) ++mark; | |
--- | |
> while (PUGI__IS_CHARTYPE(*mark, ct_space)) ++mark; | |
2234c2266 | |
< PUSHNODE(node_doctype); | |
--- | |
> PUGI__PUSHNODE(node_doctype); | |
2241c2273 | |
< POPNODE(); | |
--- | |
> PUGI__POPNODE(); | |
2244,2246c2276,2278 | |
< else if (*s == 0 && endch == '-') THROW_ERROR(status_bad_comment, s); | |
< else if (*s == 0 && endch == '[') THROW_ERROR(status_bad_cdata, s); | |
< else THROW_ERROR(status_unrecognized_tag, s); | |
--- | |
> else if (*s == 0 && endch == '-') PUGI__THROW_ERROR(status_bad_comment, s); | |
> else if (*s == 0 && endch == '[') PUGI__THROW_ERROR(status_bad_cdata, s); | |
> else PUGI__THROW_ERROR(status_unrecognized_tag, s); | |
2263c2295 | |
< if (!IS_CHARTYPE(*s, ct_start_symbol)) THROW_ERROR(status_bad_pi, s); | |
--- | |
> if (!PUGI__IS_CHARTYPE(*s, ct_start_symbol)) PUGI__THROW_ERROR(status_bad_pi, s); | |
2265,2266c2297,2298 | |
< SCANWHILE(IS_CHARTYPE(*s, ct_symbol)); | |
< CHECK_ERROR(status_bad_pi, s); | |
--- | |
> PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); | |
> PUGI__CHECK_ERROR(status_bad_pi, s); | |
2271c2303 | |
< if (declaration ? OPTSET(parse_declaration) : OPTSET(parse_pi)) | |
--- | |
> if (declaration ? PUGI__OPTSET(parse_declaration) : PUGI__OPTSET(parse_pi)) | |
2276c2308 | |
< if (cursor->parent) THROW_ERROR(status_bad_pi, s); | |
--- | |
> if (cursor->parent) PUGI__THROW_ERROR(status_bad_pi, s); | |
2278c2310 | |
< PUSHNODE(node_declaration); | |
--- | |
> PUGI__PUSHNODE(node_declaration); | |
2282c2314 | |
< PUSHNODE(node_pi); | |
--- | |
> PUGI__PUSHNODE(node_pi); | |
2287c2319 | |
< ENDSEG(); | |
--- | |
> PUGI__ENDSEG(); | |
2293c2325 | |
< if (!ENDSWITH(*s, '>')) THROW_ERROR(status_bad_pi, s); | |
--- | |
> if (!ENDSWITH(*s, '>')) PUGI__THROW_ERROR(status_bad_pi, s); | |
2296c2328 | |
< POPNODE(); | |
--- | |
> PUGI__POPNODE(); | |
2298c2330 | |
< else if (IS_CHARTYPE(ch, ct_space)) | |
--- | |
> else if (PUGI__IS_CHARTYPE(ch, ct_space)) | |
2300c2332 | |
< SKIPWS(); | |
--- | |
> PUGI__SKIPWS(); | |
2305,2306c2337,2338 | |
< SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); | |
< CHECK_ERROR(status_bad_pi, s); | |
--- | |
> PUGI__SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); | |
> PUGI__CHECK_ERROR(status_bad_pi, s); | |
2320c2352 | |
< POPNODE(); | |
--- | |
> PUGI__POPNODE(); | |
2322c2354 | |
< ENDSEG(); | |
--- | |
> PUGI__ENDSEG(); | |
2327c2359 | |
< else THROW_ERROR(status_bad_pi, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_pi, s); | |
2332,2333c2364,2365 | |
< SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); | |
< CHECK_ERROR(status_bad_pi, s); | |
--- | |
> PUGI__SCANFOR(s[0] == '?' && ENDSWITH(s[1], '>')); | |
> PUGI__CHECK_ERROR(status_bad_pi, s); | |
2360c2392 | |
< if (IS_CHARTYPE(*s, ct_start_symbol)) // '<#...' | |
--- | |
> if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) // '<#...' | |
2362c2394 | |
< PUSHNODE(node_element); // Append a new node to the tree. | |
--- | |
> PUGI__PUSHNODE(node_element); // Append a new node to the tree. | |
2366,2367c2398,2399 | |
< SCANWHILE(IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. | |
< ENDSEG(); // Save char in 'ch', terminate & step over. | |
--- | |
> PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. | |
> PUGI__ENDSEG(); // Save char in 'ch', terminate & step over. | |
2373c2405 | |
< else if (IS_CHARTYPE(ch, ct_space)) | |
--- | |
> else if (PUGI__IS_CHARTYPE(ch, ct_space)) | |
2378c2410 | |
< SKIPWS(); // Eat any whitespace. | |
--- | |
> PUGI__SKIPWS(); // Eat any whitespace. | |
2380c2412 | |
< if (IS_CHARTYPE(*s, ct_start_symbol)) // <... #... | |
--- | |
> if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) // <... #... | |
2383c2415 | |
< if (!a) THROW_ERROR(status_out_of_memory, s); | |
--- | |
> if (!a) PUGI__THROW_ERROR(status_out_of_memory, s); | |
2387,2388c2419,2420 | |
< SCANWHILE(IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. | |
< CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
--- | |
> PUGI__SCANWHILE(PUGI__IS_CHARTYPE(*s, ct_symbol)); // Scan for a terminator. | |
> PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
2390,2391c2422,2423 | |
< ENDSEG(); // Save char in 'ch', terminate & step over. | |
< CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
--- | |
> PUGI__ENDSEG(); // Save char in 'ch', terminate & step over. | |
> PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
2393c2425 | |
< if (IS_CHARTYPE(ch, ct_space)) | |
--- | |
> if (PUGI__IS_CHARTYPE(ch, ct_space)) | |
2395,2396c2427,2428 | |
< SKIPWS(); // Eat any whitespace. | |
< CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
--- | |
> PUGI__SKIPWS(); // Eat any whitespace. | |
> PUGI__CHECK_ERROR(status_bad_attribute, s); //$ redundant, left for performance | |
2404c2436 | |
< SKIPWS(); // Eat any whitespace. | |
--- | |
> PUGI__SKIPWS(); // Eat any whitespace. | |
2414c2446 | |
< if (!s) THROW_ERROR(status_bad_attribute, a->value); | |
--- | |
> if (!s) PUGI__THROW_ERROR(status_bad_attribute, a->value); | |
2419c2451 | |
< if (IS_CHARTYPE(*s, ct_start_symbol)) THROW_ERROR(status_bad_attribute, s); | |
--- | |
> if (PUGI__IS_CHARTYPE(*s, ct_start_symbol)) PUGI__THROW_ERROR(status_bad_attribute, s); | |
2421c2453 | |
< else THROW_ERROR(status_bad_attribute, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_attribute, s); | |
2423c2455 | |
< else THROW_ERROR(status_bad_attribute, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_attribute, s); | |
2431c2463 | |
< POPNODE(); | |
--- | |
> PUGI__POPNODE(); | |
2437c2469 | |
< POPNODE(); | |
--- | |
> PUGI__POPNODE(); | |
2440c2472 | |
< else THROW_ERROR(status_bad_start_element, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_start_element, s); | |
2452c2484 | |
< else THROW_ERROR(status_bad_start_element, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_start_element, s); | |
2459c2491 | |
< if (!ENDSWITH(*s, '>')) THROW_ERROR(status_bad_start_element, s); | |
--- | |
> if (!ENDSWITH(*s, '>')) PUGI__THROW_ERROR(status_bad_start_element, s); | |
2461c2493 | |
< POPNODE(); // Pop. | |
--- | |
> PUGI__POPNODE(); // Pop. | |
2470c2502 | |
< if (endch != '>') THROW_ERROR(status_bad_start_element, s); | |
--- | |
> if (endch != '>') PUGI__THROW_ERROR(status_bad_start_element, s); | |
2472c2504 | |
< else THROW_ERROR(status_bad_start_element, s); | |
--- | |
> else PUGI__THROW_ERROR(status_bad_start_element, s); | |
2479c2511 | |
< if (!name) THROW_ERROR(status_end_element_mismatch, s); | |
--- | |
> if (!name) PUGI__THROW_ERROR(status_end_element_mismatch, s); | |
2481c2513 | |
< while (IS_CHARTYPE(*s, ct_symbol)) | |
--- | |
> while (PUGI__IS_CHARTYPE(*s, ct_symbol)) | |
2483c2515 | |
< if (*s++ != *name++) THROW_ERROR(status_end_element_mismatch, s); | |
--- | |
> if (*s++ != *name++) PUGI__THROW_ERROR(status_end_element_mismatch, s); | |
2488,2489c2520,2521 | |
< if (*s == 0 && name[0] == endch && name[1] == 0) THROW_ERROR(status_bad_end_element, s); | |
< else THROW_ERROR(status_end_element_mismatch, s); | |
--- | |
> if (*s == 0 && name[0] == endch && name[1] == 0) PUGI__THROW_ERROR(status_bad_end_element, s); | |
> else PUGI__THROW_ERROR(status_end_element_mismatch, s); | |
2492c2524 | |
< POPNODE(); // Pop. | |
--- | |
> PUGI__POPNODE(); // Pop. | |
2494c2526 | |
< SKIPWS(); | |
--- | |
> PUGI__SKIPWS(); | |
2498c2530 | |
< if (endch != '>') THROW_ERROR(status_bad_end_element, s); | |
--- | |
> if (endch != '>') PUGI__THROW_ERROR(status_bad_end_element, s); | |
2502c2534 | |
< if (*s != '>') THROW_ERROR(status_bad_end_element, s); | |
--- | |
> if (*s != '>') PUGI__THROW_ERROR(status_bad_end_element, s); | |
2519,2520c2551,2552 | |
< else if (*s == 0 && endch == '?') THROW_ERROR(status_bad_pi, s); | |
< else THROW_ERROR(status_unrecognized_tag, s); | |
--- | |
> else if (*s == 0 && endch == '?') PUGI__THROW_ERROR(status_bad_pi, s); | |
> else PUGI__THROW_ERROR(status_unrecognized_tag, s); | |
2526c2558 | |
< SKIPWS(); // Eat whitespace if no genuine PCDATA here. | |
--- | |
> PUGI__SKIPWS(); // Eat whitespace if no genuine PCDATA here. | |
2533c2565 | |
< if (!OPTSET(parse_ws_pcdata | parse_ws_pcdata_single)) | |
--- | |
> if (!PUGI__OPTSET(parse_ws_pcdata | parse_ws_pcdata_single)) | |
2537c2569 | |
< else if (OPTSET(parse_ws_pcdata_single)) | |
--- | |
> else if (PUGI__OPTSET(parse_ws_pcdata_single)) | |
2547c2579 | |
< PUSHNODE(node_pcdata); // Append a new node on the tree. | |
--- | |
> PUGI__PUSHNODE(node_pcdata); // Append a new node on the tree. | |
2552c2584 | |
< POPNODE(); // Pop since this is a standalone. | |
--- | |
> PUGI__POPNODE(); // Pop since this is a standalone. | |
2558c2590 | |
< SCANFOR(*s == '<'); // '...<' | |
--- | |
> PUGI__SCANFOR(*s == '<'); // '...<' | |
2570c2602 | |
< if (cursor != xmldoc) THROW_ERROR(status_end_element_mismatch, s); | |
--- | |
> if (cursor != xmldoc) PUGI__THROW_ERROR(status_end_element_mismatch, s); | |
2613c2645 | |
< xml_encoding get_write_native_encoding() | |
--- | |
> PUGI__FN xml_encoding get_write_native_encoding() | |
2622c2654 | |
< xml_encoding get_write_encoding(xml_encoding encoding) | |
--- | |
> PUGI__FN xml_encoding get_write_encoding(xml_encoding encoding) | |
2641c2673 | |
< size_t get_valid_length(const char_t* data, size_t length) | |
--- | |
> PUGI__FN size_t get_valid_length(const char_t* data, size_t length) | |
2649c2681 | |
< size_t convert_buffer(void* result, const char_t* data, size_t length, xml_encoding encoding) | |
--- | |
> PUGI__FN size_t convert_buffer(void* result, const char_t* data, size_t length, xml_encoding encoding) | |
2713c2745 | |
< size_t get_valid_length(const char_t* data, size_t length) | |
--- | |
> PUGI__FN size_t get_valid_length(const char_t* data, size_t length) | |
2729c2761 | |
< size_t convert_buffer(void* result, const char_t* data, size_t length, xml_encoding encoding) | |
--- | |
> PUGI__FN size_t convert_buffer(void* result, const char_t* data, size_t length, xml_encoding encoding) | |
2935c2967 | |
< void write_bom(xml_writer& writer, xml_encoding encoding) | |
--- | |
> PUGI__FN void write_bom(xml_writer& writer, xml_encoding encoding) | |
2967c2999 | |
< void text_output_escaped(xml_buffered_writer& writer, const char_t* s, chartypex_t type) | |
--- | |
> PUGI__FN void text_output_escaped(xml_buffered_writer& writer, const char_t* s, chartypex_t type) | |
2974c3006 | |
< while (!IS_CHARTYPEX(*s, type)) ++s; | |
--- | |
> while (!PUGI__IS_CHARTYPEX(*s, type)) ++s; | |
3008c3040 | |
< void text_output(xml_buffered_writer& writer, const char_t* s, chartypex_t type, unsigned int flags) | |
--- | |
> PUGI__FN void text_output(xml_buffered_writer& writer, const char_t* s, chartypex_t type, unsigned int flags) | |
3016c3048 | |
< void text_output_cdata(xml_buffered_writer& writer, const char_t* s) | |
--- | |
> PUGI__FN void text_output_cdata(xml_buffered_writer& writer, const char_t* s) | |
3038c3070 | |
< void node_output_attributes(xml_buffered_writer& writer, const xml_node& node, unsigned int flags) | |
--- | |
> PUGI__FN void node_output_attributes(xml_buffered_writer& writer, const xml_node& node, unsigned int flags) | |
3054c3086 | |
< void node_output(xml_buffered_writer& writer, const xml_node& node, const char_t* indent, unsigned int flags, unsigned int depth) | |
--- | |
> PUGI__FN void node_output(xml_buffered_writer& writer, const xml_node& node, const char_t* indent, unsigned int flags, unsigned int depth) | |
3205c3237 | |
< void recursive_copy_skip(xml_node& dest, const xml_node& source, const xml_node& skip) | |
--- | |
> PUGI__FN void recursive_copy_skip(xml_node& dest, const xml_node& source, const xml_node& skip) | |
3259c3291 | |
< xml_parse_status get_file_size(FILE* file, size_t& out_result) | |
--- | |
> PUGI__FN xml_parse_status get_file_size(FILE* file, size_t& out_result) | |
3261c3293 | |
< #if defined(MSVC_CRT_VERSION) && MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) | |
--- | |
> #if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) | |
3298c3330 | |
< xml_parse_result load_file_impl(xml_document& doc, FILE* file, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result load_file_impl(xml_document& doc, FILE* file, unsigned int options, xml_encoding encoding) | |
3313c3345 | |
< char* contents = static_cast<char*>(global_allocate(size > 0 ? size : 1)); | |
--- | |
> char* contents = static_cast<char*>(xml_memory::allocate(size > 0 ? size : 1)); | |
3327c3359 | |
< global_deallocate(contents); | |
--- | |
> xml_memory::deallocate(contents); | |
3339c3371 | |
< void* memory = global_allocate(sizeof(xml_stream_chunk)); | |
--- | |
> void* memory = xml_memory::allocate(sizeof(xml_stream_chunk)); | |
3352c3384 | |
< global_deallocate(chunk); | |
--- | |
> xml_memory::deallocate(chunk); | |
3367c3399 | |
< template <typename T> xml_parse_status load_stream_data_noseek(std::basic_istream<T>& stream, void** out_buffer, size_t* out_size) | |
--- | |
> template <typename T> PUGI__FN xml_parse_status load_stream_data_noseek(std::basic_istream<T>& stream, void** out_buffer, size_t* out_size) | |
3398c3430 | |
< char* buffer = static_cast<char*>(global_allocate(total)); | |
--- | |
> char* buffer = static_cast<char*>(xml_memory::allocate(total)); | |
3419c3451 | |
< template <typename T> xml_parse_status load_stream_data_seek(std::basic_istream<T>& stream, void** out_buffer, size_t* out_size) | |
--- | |
> template <typename T> PUGI__FN xml_parse_status load_stream_data_seek(std::basic_istream<T>& stream, void** out_buffer, size_t* out_size) | |
3435c3467 | |
< buffer_holder buffer(global_allocate((read_length > 0 ? read_length : 1) * sizeof(T)), global_deallocate); | |
--- | |
> buffer_holder buffer(xml_memory::allocate((read_length > 0 ? read_length : 1) * sizeof(T)), xml_memory::deallocate); | |
3453c3485 | |
< template <typename T> xml_parse_result load_stream_impl(xml_document& doc, std::basic_istream<T>& stream, unsigned int options, xml_encoding encoding) | |
--- | |
> template <typename T> PUGI__FN xml_parse_result load_stream_impl(xml_document& doc, std::basic_istream<T>& stream, unsigned int options, xml_encoding encoding) | |
3466,3467c3498,3499 | |
< #if defined(MSVC_CRT_VERSION) || defined(__BORLANDC__) || defined(__MINGW32__) | |
< FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) | |
--- | |
> #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) || defined(__MINGW32__) | |
> PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) | |
3472c3504 | |
< char* convert_path_heap(const wchar_t* str) | |
--- | |
> PUGI__FN char* convert_path_heap(const wchar_t* str) | |
3481c3513 | |
< char* result = static_cast<char*>(global_allocate(size + 1)); | |
--- | |
> char* result = static_cast<char*>(xml_memory::allocate(size + 1)); | |
3490c3522 | |
< FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) | |
--- | |
> PUGI__FN FILE* open_file_wide(const wchar_t* path, const wchar_t* mode) | |
3504c3536 | |
< global_deallocate(path_utf8); | |
--- | |
> xml_memory::deallocate(path_utf8); | |
3513c3545 | |
< xml_writer_file::xml_writer_file(void* file_): file(file_) | |
--- | |
> PUGI__FN xml_writer_file::xml_writer_file(void* file_): file(file_) | |
3517c3549 | |
< void xml_writer_file::write(const void* data, size_t size) | |
--- | |
> PUGI__FN void xml_writer_file::write(const void* data, size_t size) | |
3523c3555 | |
< xml_writer_stream::xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(0) | |
--- | |
> PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(0) | |
3527c3559 | |
< xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream): narrow_stream(0), wide_stream(&stream) | |
--- | |
> PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream): narrow_stream(0), wide_stream(&stream) | |
3531c3563 | |
< void xml_writer_stream::write(const void* data, size_t size) | |
--- | |
> PUGI__FN void xml_writer_stream::write(const void* data, size_t size) | |
3548c3580 | |
< xml_tree_walker::xml_tree_walker(): _depth(0) | |
--- | |
> PUGI__FN xml_tree_walker::xml_tree_walker(): _depth(0) | |
3552c3584 | |
< xml_tree_walker::~xml_tree_walker() | |
--- | |
> PUGI__FN xml_tree_walker::~xml_tree_walker() | |
3556c3588 | |
< int xml_tree_walker::depth() const | |
--- | |
> PUGI__FN int xml_tree_walker::depth() const | |
3561c3593 | |
< bool xml_tree_walker::begin(xml_node&) | |
--- | |
> PUGI__FN bool xml_tree_walker::begin(xml_node&) | |
3566c3598 | |
< bool xml_tree_walker::end(xml_node&) | |
--- | |
> PUGI__FN bool xml_tree_walker::end(xml_node&) | |
3571c3603 | |
< xml_attribute::xml_attribute(): _attr(0) | |
--- | |
> PUGI__FN xml_attribute::xml_attribute(): _attr(0) | |
3575c3607 | |
< xml_attribute::xml_attribute(xml_attribute_struct* attr): _attr(attr) | |
--- | |
> PUGI__FN xml_attribute::xml_attribute(xml_attribute_struct* attr): _attr(attr) | |
3579c3611 | |
< static void unspecified_bool_xml_attribute(xml_attribute***) | |
--- | |
> PUGI__FN static void unspecified_bool_xml_attribute(xml_attribute***) | |
3583c3615 | |
< xml_attribute::operator xml_attribute::unspecified_bool_type() const | |
--- | |
> PUGI__FN xml_attribute::operator xml_attribute::unspecified_bool_type() const | |
3588c3620 | |
< bool xml_attribute::operator!() const | |
--- | |
> PUGI__FN bool xml_attribute::operator!() const | |
3593c3625 | |
< bool xml_attribute::operator==(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator==(const xml_attribute& r) const | |
3598c3630 | |
< bool xml_attribute::operator!=(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator!=(const xml_attribute& r) const | |
3603c3635 | |
< bool xml_attribute::operator<(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator<(const xml_attribute& r) const | |
3608c3640 | |
< bool xml_attribute::operator>(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator>(const xml_attribute& r) const | |
3613c3645 | |
< bool xml_attribute::operator<=(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator<=(const xml_attribute& r) const | |
3618c3650 | |
< bool xml_attribute::operator>=(const xml_attribute& r) const | |
--- | |
> PUGI__FN bool xml_attribute::operator>=(const xml_attribute& r) const | |
3623c3655 | |
< xml_attribute xml_attribute::next_attribute() const | |
--- | |
> PUGI__FN xml_attribute xml_attribute::next_attribute() const | |
3628c3660 | |
< xml_attribute xml_attribute::previous_attribute() const | |
--- | |
> PUGI__FN xml_attribute xml_attribute::previous_attribute() const | |
3633c3665 | |
< int xml_attribute::as_int() const | |
--- | |
> PUGI__FN int xml_attribute::as_int() const | |
3644c3676 | |
< unsigned int xml_attribute::as_uint() const | |
--- | |
> PUGI__FN unsigned int xml_attribute::as_uint() const | |
3655c3687 | |
< double xml_attribute::as_double() const | |
--- | |
> PUGI__FN double xml_attribute::as_double() const | |
3666c3698 | |
< float xml_attribute::as_float() const | |
--- | |
> PUGI__FN float xml_attribute::as_float() const | |
3677c3709 | |
< bool xml_attribute::as_bool() const | |
--- | |
> PUGI__FN bool xml_attribute::as_bool() const | |
3688c3720 | |
< bool xml_attribute::empty() const | |
--- | |
> PUGI__FN bool xml_attribute::empty() const | |
3693c3725 | |
< const char_t* xml_attribute::name() const | |
--- | |
> PUGI__FN const char_t* xml_attribute::name() const | |
3698c3730 | |
< const char_t* xml_attribute::value() const | |
--- | |
> PUGI__FN const char_t* xml_attribute::value() const | |
3703c3735 | |
< size_t xml_attribute::hash_value() const | |
--- | |
> PUGI__FN size_t xml_attribute::hash_value() const | |
3708c3740 | |
< xml_attribute_struct* xml_attribute::internal_object() const | |
--- | |
> PUGI__FN xml_attribute_struct* xml_attribute::internal_object() const | |
3713c3745 | |
< xml_attribute& xml_attribute::operator=(const char_t* rhs) | |
--- | |
> PUGI__FN xml_attribute& xml_attribute::operator=(const char_t* rhs) | |
3719c3751 | |
< xml_attribute& xml_attribute::operator=(int rhs) | |
--- | |
> PUGI__FN xml_attribute& xml_attribute::operator=(int rhs) | |
3725c3757 | |
< xml_attribute& xml_attribute::operator=(unsigned int rhs) | |
--- | |
> PUGI__FN xml_attribute& xml_attribute::operator=(unsigned int rhs) | |
3731c3763 | |
< xml_attribute& xml_attribute::operator=(double rhs) | |
--- | |
> PUGI__FN xml_attribute& xml_attribute::operator=(double rhs) | |
3737c3769 | |
< xml_attribute& xml_attribute::operator=(bool rhs) | |
--- | |
> PUGI__FN xml_attribute& xml_attribute::operator=(bool rhs) | |
3743c3775 | |
< bool xml_attribute::set_name(const char_t* rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_name(const char_t* rhs) | |
3747c3779 | |
< return strcpy_insitu(_attr->name, _attr->header, xml_memory_page_name_allocated_mask, rhs); | |
--- | |
> return PUGI__NSQ strcpy_insitu(_attr->name, _attr->header, PUGI__NSQ xml_memory_page_name_allocated_mask, rhs); | |
3750c3782 | |
< bool xml_attribute::set_value(const char_t* rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_value(const char_t* rhs) | |
3754c3786 | |
< return strcpy_insitu(_attr->value, _attr->header, xml_memory_page_value_allocated_mask, rhs); | |
--- | |
> return PUGI__NSQ strcpy_insitu(_attr->value, _attr->header, PUGI__NSQ xml_memory_page_value_allocated_mask, rhs); | |
3757c3789 | |
< bool xml_attribute::set_value(int rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_value(int rhs) | |
3764c3796 | |
< widen_ascii(wbuf, buf); | |
--- | |
> PUGI__NSQ widen_ascii(wbuf, buf); | |
3772c3804 | |
< bool xml_attribute::set_value(unsigned int rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_value(unsigned int rhs) | |
3779c3811 | |
< widen_ascii(wbuf, buf); | |
--- | |
> PUGI__NSQ widen_ascii(wbuf, buf); | |
3787c3819 | |
< bool xml_attribute::set_value(double rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_value(double rhs) | |
3794c3826 | |
< widen_ascii(wbuf, buf); | |
--- | |
> PUGI__NSQ widen_ascii(wbuf, buf); | |
3802c3834 | |
< bool xml_attribute::set_value(bool rhs) | |
--- | |
> PUGI__FN bool xml_attribute::set_value(bool rhs) | |
3808c3840 | |
< bool operator&&(const xml_attribute& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator&&(const xml_attribute& lhs, bool rhs) | |
3813c3845 | |
< bool operator||(const xml_attribute& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator||(const xml_attribute& lhs, bool rhs) | |
3819c3851 | |
< xml_node::xml_node(): _root(0) | |
--- | |
> PUGI__FN xml_node::xml_node(): _root(0) | |
3823c3855 | |
< xml_node::xml_node(xml_node_struct* p): _root(p) | |
--- | |
> PUGI__FN xml_node::xml_node(xml_node_struct* p): _root(p) | |
3827c3859 | |
< static void unspecified_bool_xml_node(xml_node***) | |
--- | |
> PUGI__FN static void unspecified_bool_xml_node(xml_node***) | |
3831c3863 | |
< xml_node::operator xml_node::unspecified_bool_type() const | |
--- | |
> PUGI__FN xml_node::operator xml_node::unspecified_bool_type() const | |
3836c3868 | |
< bool xml_node::operator!() const | |
--- | |
> PUGI__FN bool xml_node::operator!() const | |
3841c3873 | |
< xml_node::iterator xml_node::begin() const | |
--- | |
> PUGI__FN xml_node::iterator xml_node::begin() const | |
3846c3878 | |
< xml_node::iterator xml_node::end() const | |
--- | |
> PUGI__FN xml_node::iterator xml_node::end() const | |
3851c3883 | |
< xml_node::attribute_iterator xml_node::attributes_begin() const | |
--- | |
> PUGI__FN xml_node::attribute_iterator xml_node::attributes_begin() const | |
3856c3888 | |
< xml_node::attribute_iterator xml_node::attributes_end() const | |
--- | |
> PUGI__FN xml_node::attribute_iterator xml_node::attributes_end() const | |
3861c3893 | |
< bool xml_node::operator==(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator==(const xml_node& r) const | |
3866c3898 | |
< bool xml_node::operator!=(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator!=(const xml_node& r) const | |
3871c3903 | |
< bool xml_node::operator<(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator<(const xml_node& r) const | |
3876c3908 | |
< bool xml_node::operator>(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator>(const xml_node& r) const | |
3881c3913 | |
< bool xml_node::operator<=(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator<=(const xml_node& r) const | |
3886c3918 | |
< bool xml_node::operator>=(const xml_node& r) const | |
--- | |
> PUGI__FN bool xml_node::operator>=(const xml_node& r) const | |
3891c3923 | |
< bool xml_node::empty() const | |
--- | |
> PUGI__FN bool xml_node::empty() const | |
3896c3928 | |
< const char_t* xml_node::name() const | |
--- | |
> PUGI__FN const char_t* xml_node::name() const | |
3901c3933 | |
< xml_node_type xml_node::type() const | |
--- | |
> PUGI__FN xml_node_type xml_node::type() const | |
3903c3935 | |
< return _root ? static_cast<xml_node_type>((_root->header & xml_memory_page_type_mask) + 1) : node_null; | |
--- | |
> return _root ? static_cast<xml_node_type>((_root->header & PUGI__NSQ xml_memory_page_type_mask) + 1) : node_null; | |
3906c3938 | |
< const char_t* xml_node::value() const | |
--- | |
> PUGI__FN const char_t* xml_node::value() const | |
3911c3943 | |
< xml_node xml_node::child(const char_t* name_) const | |
--- | |
> PUGI__FN xml_node xml_node::child(const char_t* name_) const | |
3916c3948 | |
< if (i->name && strequal(name_, i->name)) return xml_node(i); | |
--- | |
> if (i->name && PUGI__NSQ strequal(name_, i->name)) return xml_node(i); | |
3921c3953 | |
< xml_attribute xml_node::attribute(const char_t* name_) const | |
--- | |
> PUGI__FN xml_attribute xml_node::attribute(const char_t* name_) const | |
3926c3958 | |
< if (i->name && strequal(name_, i->name)) | |
--- | |
> if (i->name && PUGI__NSQ strequal(name_, i->name)) | |
3932c3964 | |
< xml_node xml_node::next_sibling(const char_t* name_) const | |
--- | |
> PUGI__FN xml_node xml_node::next_sibling(const char_t* name_) const | |
3937c3969 | |
< if (i->name && strequal(name_, i->name)) return xml_node(i); | |
--- | |
> if (i->name && PUGI__NSQ strequal(name_, i->name)) return xml_node(i); | |
3942c3974 | |
< xml_node xml_node::next_sibling() const | |
--- | |
> PUGI__FN xml_node xml_node::next_sibling() const | |
3950c3982 | |
< xml_node xml_node::previous_sibling(const char_t* name_) const | |
--- | |
> PUGI__FN xml_node xml_node::previous_sibling(const char_t* name_) const | |
3955c3987 | |
< if (i->name && strequal(name_, i->name)) return xml_node(i); | |
--- | |
> if (i->name && PUGI__NSQ strequal(name_, i->name)) return xml_node(i); | |
3960c3992 | |
< xml_node xml_node::previous_sibling() const | |
--- | |
> PUGI__FN xml_node xml_node::previous_sibling() const | |
3968c4000 | |
< xml_node xml_node::parent() const | |
--- | |
> PUGI__FN xml_node xml_node::parent() const | |
3973c4005 | |
< xml_node xml_node::root() const | |
--- | |
> PUGI__FN xml_node xml_node::root() const | |
3977c4009 | |
< xml_memory_page* page = reinterpret_cast<xml_memory_page*>(_root->header & xml_memory_page_pointer_mask); | |
--- | |
> PUGI__NSQ xml_memory_page* page = reinterpret_cast<PUGI__NSQ xml_memory_page*>(_root->header & PUGI__NSQ xml_memory_page_pointer_mask); | |
3979c4011 | |
< return xml_node(static_cast<xml_document_struct*>(page->allocator)); | |
--- | |
> return xml_node(static_cast<PUGI__NSQ xml_document_struct*>(page->allocator)); | |
3982c4014 | |
< const char_t* xml_node::child_value() const | |
--- | |
> PUGI__FN const char_t* xml_node::child_value() const | |
3988c4020 | |
< xml_node_type type_ = static_cast<xml_node_type>((i->header & xml_memory_page_type_mask) + 1); | |
--- | |
> xml_node_type type_ = static_cast<xml_node_type>((i->header & PUGI__NSQ xml_memory_page_type_mask) + 1); | |
3997c4029 | |
< const char_t* xml_node::child_value(const char_t* name_) const | |
--- | |
> PUGI__FN const char_t* xml_node::child_value(const char_t* name_) const | |
4002c4034 | |
< xml_attribute xml_node::first_attribute() const | |
--- | |
> PUGI__FN xml_attribute xml_node::first_attribute() const | |
4007c4039 | |
< xml_attribute xml_node::last_attribute() const | |
--- | |
> PUGI__FN xml_attribute xml_node::last_attribute() const | |
4012c4044 | |
< xml_node xml_node::first_child() const | |
--- | |
> PUGI__FN xml_node xml_node::first_child() const | |
4017c4049 | |
< xml_node xml_node::last_child() const | |
--- | |
> PUGI__FN xml_node xml_node::last_child() const | |
4022c4054 | |
< bool xml_node::set_name(const char_t* rhs) | |
--- | |
> PUGI__FN bool xml_node::set_name(const char_t* rhs) | |
4029c4061 | |
< return strcpy_insitu(_root->name, _root->header, xml_memory_page_name_allocated_mask, rhs); | |
--- | |
> return PUGI__NSQ strcpy_insitu(_root->name, _root->header, PUGI__NSQ xml_memory_page_name_allocated_mask, rhs); | |
4036c4068 | |
< bool xml_node::set_value(const char_t* rhs) | |
--- | |
> PUGI__FN bool xml_node::set_value(const char_t* rhs) | |
4045c4077 | |
< return strcpy_insitu(_root->value, _root->header, xml_memory_page_value_allocated_mask, rhs); | |
--- | |
> return PUGI__NSQ strcpy_insitu(_root->value, _root->header, PUGI__NSQ xml_memory_page_value_allocated_mask, rhs); | |
4052c4084 | |
< xml_attribute xml_node::append_attribute(const char_t* name_) | |
--- | |
> PUGI__FN xml_attribute xml_node::append_attribute(const char_t* name_) | |
4056c4088 | |
< xml_attribute a(append_attribute_ll(_root, get_allocator(_root))); | |
--- | |
> xml_attribute a(PUGI__NSQ append_attribute_ll(_root, PUGI__NSQ get_allocator(_root))); | |
4062c4094 | |
< xml_attribute xml_node::prepend_attribute(const char_t* name_) | |
--- | |
> PUGI__FN xml_attribute xml_node::prepend_attribute(const char_t* name_) | |
4066c4098 | |
< xml_attribute a(allocate_attribute(get_allocator(_root))); | |
--- | |
> xml_attribute a(PUGI__NSQ allocate_attribute(PUGI__NSQ get_allocator(_root))); | |
4087c4119 | |
< xml_attribute xml_node::insert_attribute_before(const char_t* name_, const xml_attribute& attr) | |
--- | |
> PUGI__FN xml_attribute xml_node::insert_attribute_before(const char_t* name_, const xml_attribute& attr) | |
4098c4130 | |
< xml_attribute a(allocate_attribute(get_allocator(_root))); | |
--- | |
> xml_attribute a(PUGI__NSQ allocate_attribute(PUGI__NSQ get_allocator(_root))); | |
4115c4147 | |
< xml_attribute xml_node::insert_attribute_after(const char_t* name_, const xml_attribute& attr) | |
--- | |
> PUGI__FN xml_attribute xml_node::insert_attribute_after(const char_t* name_, const xml_attribute& attr) | |
4126c4158 | |
< xml_attribute a(allocate_attribute(get_allocator(_root))); | |
--- | |
> xml_attribute a(PUGI__NSQ allocate_attribute(PUGI__NSQ get_allocator(_root))); | |
4143c4175 | |
< xml_attribute xml_node::append_copy(const xml_attribute& proto) | |
--- | |
> PUGI__FN xml_attribute xml_node::append_copy(const xml_attribute& proto) | |
4153c4185 | |
< xml_attribute xml_node::prepend_copy(const xml_attribute& proto) | |
--- | |
> PUGI__FN xml_attribute xml_node::prepend_copy(const xml_attribute& proto) | |
4163c4195 | |
< xml_attribute xml_node::insert_copy_after(const xml_attribute& proto, const xml_attribute& attr) | |
--- | |
> PUGI__FN xml_attribute xml_node::insert_copy_after(const xml_attribute& proto, const xml_attribute& attr) | |
4173c4205 | |
< xml_attribute xml_node::insert_copy_before(const xml_attribute& proto, const xml_attribute& attr) | |
--- | |
> PUGI__FN xml_attribute xml_node::insert_copy_before(const xml_attribute& proto, const xml_attribute& attr) | |
4183c4215 | |
< xml_node xml_node::append_child(xml_node_type type_) | |
--- | |
> PUGI__FN xml_node xml_node::append_child(xml_node_type type_) | |
4185c4217 | |
< if (!allow_insert_child(this->type(), type_)) return xml_node(); | |
--- | |
> if (!PUGI__NSQ allow_insert_child(this->type(), type_)) return xml_node(); | |
4187c4219 | |
< xml_node n(append_node(_root, get_allocator(_root), type_)); | |
--- | |
> xml_node n(PUGI__NSQ append_node(_root, PUGI__NSQ get_allocator(_root), type_)); | |
4194c4226 | |
< xml_node xml_node::prepend_child(xml_node_type type_) | |
--- | |
> PUGI__FN xml_node xml_node::prepend_child(xml_node_type type_) | |
4196c4228 | |
< if (!allow_insert_child(this->type(), type_)) return xml_node(); | |
--- | |
> if (!PUGI__NSQ allow_insert_child(this->type(), type_)) return xml_node(); | |
4198c4230 | |
< xml_node n(allocate_node(get_allocator(_root), type_)); | |
--- | |
> xml_node n(PUGI__NSQ allocate_node(PUGI__NSQ get_allocator(_root), type_)); | |
4221c4253 | |
< xml_node xml_node::insert_child_before(xml_node_type type_, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_child_before(xml_node_type type_, const xml_node& node) | |
4223c4255 | |
< if (!allow_insert_child(this->type(), type_)) return xml_node(); | |
--- | |
> if (!PUGI__NSQ allow_insert_child(this->type(), type_)) return xml_node(); | |
4226c4258 | |
< xml_node n(allocate_node(get_allocator(_root), type_)); | |
--- | |
> xml_node n(PUGI__NSQ allocate_node(PUGI__NSQ get_allocator(_root), type_)); | |
4245c4277 | |
< xml_node xml_node::insert_child_after(xml_node_type type_, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_child_after(xml_node_type type_, const xml_node& node) | |
4247c4279 | |
< if (!allow_insert_child(this->type(), type_)) return xml_node(); | |
--- | |
> if (!PUGI__NSQ allow_insert_child(this->type(), type_)) return xml_node(); | |
4250c4282 | |
< xml_node n(allocate_node(get_allocator(_root), type_)); | |
--- | |
> xml_node n(PUGI__NSQ allocate_node(PUGI__NSQ get_allocator(_root), type_)); | |
4269c4301 | |
< xml_node xml_node::append_child(const char_t* name_) | |
--- | |
> PUGI__FN xml_node xml_node::append_child(const char_t* name_) | |
4278c4310 | |
< xml_node xml_node::prepend_child(const char_t* name_) | |
--- | |
> PUGI__FN xml_node xml_node::prepend_child(const char_t* name_) | |
4287c4319 | |
< xml_node xml_node::insert_child_after(const char_t* name_, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_child_after(const char_t* name_, const xml_node& node) | |
4296c4328 | |
< xml_node xml_node::insert_child_before(const char_t* name_, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_child_before(const char_t* name_, const xml_node& node) | |
4305c4337 | |
< xml_node xml_node::append_copy(const xml_node& proto) | |
--- | |
> PUGI__FN xml_node xml_node::append_copy(const xml_node& proto) | |
4309c4341 | |
< if (result) recursive_copy_skip(result, proto, result); | |
--- | |
> if (result) PUGI__NSQ recursive_copy_skip(result, proto, result); | |
4314c4346 | |
< xml_node xml_node::prepend_copy(const xml_node& proto) | |
--- | |
> PUGI__FN xml_node xml_node::prepend_copy(const xml_node& proto) | |
4318c4350 | |
< if (result) recursive_copy_skip(result, proto, result); | |
--- | |
> if (result) PUGI__NSQ recursive_copy_skip(result, proto, result); | |
4323c4355 | |
< xml_node xml_node::insert_copy_after(const xml_node& proto, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_copy_after(const xml_node& proto, const xml_node& node) | |
4327c4359 | |
< if (result) recursive_copy_skip(result, proto, result); | |
--- | |
> if (result) PUGI__NSQ recursive_copy_skip(result, proto, result); | |
4332c4364 | |
< xml_node xml_node::insert_copy_before(const xml_node& proto, const xml_node& node) | |
--- | |
> PUGI__FN xml_node xml_node::insert_copy_before(const xml_node& proto, const xml_node& node) | |
4336c4368 | |
< if (result) recursive_copy_skip(result, proto, result); | |
--- | |
> if (result) PUGI__NSQ recursive_copy_skip(result, proto, result); | |
4341c4373 | |
< bool xml_node::remove_attribute(const char_t* name_) | |
--- | |
> PUGI__FN bool xml_node::remove_attribute(const char_t* name_) | |
4346c4378 | |
< bool xml_node::remove_attribute(const xml_attribute& a) | |
--- | |
> PUGI__FN bool xml_node::remove_attribute(const xml_attribute& a) | |
4363c4395 | |
< destroy_attribute(a._attr, get_allocator(_root)); | |
--- | |
> PUGI__NSQ destroy_attribute(a._attr, PUGI__NSQ get_allocator(_root)); | |
4368c4400 | |
< bool xml_node::remove_child(const char_t* name_) | |
--- | |
> PUGI__FN bool xml_node::remove_child(const char_t* name_) | |
4373c4405 | |
< bool xml_node::remove_child(const xml_node& n) | |
--- | |
> PUGI__FN bool xml_node::remove_child(const xml_node& n) | |
4383c4415 | |
< destroy_node(n._root, get_allocator(_root)); | |
--- | |
> PUGI__NSQ destroy_node(n._root, PUGI__NSQ get_allocator(_root)); | |
4388c4420 | |
< xml_node xml_node::find_child_by_attribute(const char_t* name_, const char_t* attr_name, const char_t* attr_value) const | |
--- | |
> PUGI__FN xml_node xml_node::find_child_by_attribute(const char_t* name_, const char_t* attr_name, const char_t* attr_value) const | |
4393c4425 | |
< if (i->name && strequal(name_, i->name)) | |
--- | |
> if (i->name && PUGI__NSQ strequal(name_, i->name)) | |
4396c4428 | |
< if (strequal(attr_name, a->name) && strequal(attr_value, a->value)) | |
--- | |
> if (PUGI__NSQ strequal(attr_name, a->name) && PUGI__NSQ strequal(attr_value, a->value)) | |
4403c4435 | |
< xml_node xml_node::find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const | |
--- | |
> PUGI__FN xml_node xml_node::find_child_by_attribute(const char_t* attr_name, const char_t* attr_value) const | |
4409c4441 | |
< if (strequal(attr_name, a->name) && strequal(attr_value, a->value)) | |
--- | |
> if (PUGI__NSQ strequal(attr_name, a->name) && PUGI__NSQ strequal(attr_value, a->value)) | |
4416c4448 | |
< string_t xml_node::path(char_t delimiter) const | |
--- | |
> PUGI__FN string_t xml_node::path(char_t delimiter) const | |
4436c4468 | |
< xml_node xml_node::first_element_by_path(const char_t* path_, char_t delimiter) const | |
--- | |
> PUGI__FN xml_node xml_node::first_element_by_path(const char_t* path_, char_t delimiter) const | |
4471c4503 | |
< if (j->name && strequalrange(j->name, path_segment, static_cast<size_t>(path_segment_end - path_segment))) | |
--- | |
> if (j->name && PUGI__NSQ strequalrange(j->name, path_segment, static_cast<size_t>(path_segment_end - path_segment))) | |
4483c4515 | |
< bool xml_node::traverse(xml_tree_walker& walker) | |
--- | |
> PUGI__FN bool xml_node::traverse(xml_tree_walker& walker) | |
4531c4563 | |
< size_t xml_node::hash_value() const | |
--- | |
> PUGI__FN size_t xml_node::hash_value() const | |
4536c4568 | |
< xml_node_struct* xml_node::internal_object() const | |
--- | |
> PUGI__FN xml_node_struct* xml_node::internal_object() const | |
4541c4573 | |
< void xml_node::print(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const | |
--- | |
> PUGI__FN void xml_node::print(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const | |
4545c4577 | |
< xml_buffered_writer buffered_writer(writer, encoding); | |
--- | |
> PUGI__NSQ xml_buffered_writer buffered_writer(writer, encoding); | |
4547c4579 | |
< node_output(buffered_writer, *this, indent, flags, depth); | |
--- | |
> PUGI__NSQ node_output(buffered_writer, *this, indent, flags, depth); | |
4551c4583 | |
< void xml_node::print(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const | |
--- | |
> PUGI__FN void xml_node::print(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const | |
4558c4590 | |
< void xml_node::print(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent, unsigned int flags, unsigned int depth) const | |
--- | |
> PUGI__FN void xml_node::print(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent, unsigned int flags, unsigned int depth) const | |
4566c4598 | |
< ptrdiff_t xml_node::offset_debug() const | |
--- | |
> PUGI__FN ptrdiff_t xml_node::offset_debug() const | |
4572c4604 | |
< const char_t* buffer = static_cast<xml_document_struct*>(r)->buffer; | |
--- | |
> const char_t* buffer = static_cast<PUGI__NSQ xml_document_struct*>(r)->buffer; | |
4584c4616 | |
< return (_root->header & xml_memory_page_name_allocated_mask) ? -1 : _root->name - buffer; | |
--- | |
> return (_root->header & PUGI__NSQ xml_memory_page_name_allocated_mask) ? -1 : _root->name - buffer; | |
4590c4622 | |
< return (_root->header & xml_memory_page_value_allocated_mask) ? -1 : _root->value - buffer; | |
--- | |
> return (_root->header & PUGI__NSQ xml_memory_page_value_allocated_mask) ? -1 : _root->value - buffer; | |
4598c4630 | |
< bool operator&&(const xml_node& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator&&(const xml_node& lhs, bool rhs) | |
4603c4635 | |
< bool operator||(const xml_node& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator||(const xml_node& lhs, bool rhs) | |
4609c4641 | |
< xml_node_iterator::xml_node_iterator() | |
--- | |
> PUGI__FN xml_node_iterator::xml_node_iterator() | |
4613c4645 | |
< xml_node_iterator::xml_node_iterator(const xml_node& node): _wrap(node), _parent(node.parent()) | |
--- | |
> PUGI__FN xml_node_iterator::xml_node_iterator(const xml_node& node): _wrap(node), _parent(node.parent()) | |
4617c4649 | |
< xml_node_iterator::xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) | |
--- | |
> PUGI__FN xml_node_iterator::xml_node_iterator(xml_node_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) | |
4621c4653 | |
< bool xml_node_iterator::operator==(const xml_node_iterator& rhs) const | |
--- | |
> PUGI__FN bool xml_node_iterator::operator==(const xml_node_iterator& rhs) const | |
4626c4658 | |
< bool xml_node_iterator::operator!=(const xml_node_iterator& rhs) const | |
--- | |
> PUGI__FN bool xml_node_iterator::operator!=(const xml_node_iterator& rhs) const | |
4631c4663 | |
< xml_node& xml_node_iterator::operator*() | |
--- | |
> PUGI__FN xml_node& xml_node_iterator::operator*() | |
4637c4669 | |
< xml_node* xml_node_iterator::operator->() | |
--- | |
> PUGI__FN xml_node* xml_node_iterator::operator->() | |
4643c4675 | |
< const xml_node_iterator& xml_node_iterator::operator++() | |
--- | |
> PUGI__FN const xml_node_iterator& xml_node_iterator::operator++() | |
4650c4682 | |
< xml_node_iterator xml_node_iterator::operator++(int) | |
--- | |
> PUGI__FN xml_node_iterator xml_node_iterator::operator++(int) | |
4657c4689 | |
< const xml_node_iterator& xml_node_iterator::operator--() | |
--- | |
> PUGI__FN const xml_node_iterator& xml_node_iterator::operator--() | |
4663c4695 | |
< xml_node_iterator xml_node_iterator::operator--(int) | |
--- | |
> PUGI__FN xml_node_iterator xml_node_iterator::operator--(int) | |
4670c4702 | |
< xml_attribute_iterator::xml_attribute_iterator() | |
--- | |
> PUGI__FN xml_attribute_iterator::xml_attribute_iterator() | |
4674c4706 | |
< xml_attribute_iterator::xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent): _wrap(attr), _parent(parent) | |
--- | |
> PUGI__FN xml_attribute_iterator::xml_attribute_iterator(const xml_attribute& attr, const xml_node& parent): _wrap(attr), _parent(parent) | |
4678c4710 | |
< xml_attribute_iterator::xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) | |
--- | |
> PUGI__FN xml_attribute_iterator::xml_attribute_iterator(xml_attribute_struct* ref, xml_node_struct* parent): _wrap(ref), _parent(parent) | |
4682c4714 | |
< bool xml_attribute_iterator::operator==(const xml_attribute_iterator& rhs) const | |
--- | |
> PUGI__FN bool xml_attribute_iterator::operator==(const xml_attribute_iterator& rhs) const | |
4687c4719 | |
< bool xml_attribute_iterator::operator!=(const xml_attribute_iterator& rhs) const | |
--- | |
> PUGI__FN bool xml_attribute_iterator::operator!=(const xml_attribute_iterator& rhs) const | |
4692c4724 | |
< xml_attribute& xml_attribute_iterator::operator*() | |
--- | |
> PUGI__FN xml_attribute& xml_attribute_iterator::operator*() | |
4698c4730 | |
< xml_attribute* xml_attribute_iterator::operator->() | |
--- | |
> PUGI__FN xml_attribute* xml_attribute_iterator::operator->() | |
4704c4736 | |
< const xml_attribute_iterator& xml_attribute_iterator::operator++() | |
--- | |
> PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator++() | |
4711c4743 | |
< xml_attribute_iterator xml_attribute_iterator::operator++(int) | |
--- | |
> PUGI__FN xml_attribute_iterator xml_attribute_iterator::operator++(int) | |
4718c4750 | |
< const xml_attribute_iterator& xml_attribute_iterator::operator--() | |
--- | |
> PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator--() | |
4724c4756 | |
< xml_attribute_iterator xml_attribute_iterator::operator--(int) | |
--- | |
> PUGI__FN xml_attribute_iterator xml_attribute_iterator::operator--(int) | |
4731c4763 | |
< xml_parse_result::xml_parse_result(): status(status_internal_error), offset(0), encoding(encoding_auto) | |
--- | |
> PUGI__FN xml_parse_result::xml_parse_result(): status(status_internal_error), offset(0), encoding(encoding_auto) | |
4735c4767 | |
< xml_parse_result::operator bool() const | |
--- | |
> PUGI__FN xml_parse_result::operator bool() const | |
4740c4772 | |
< const char* xml_parse_result::description() const | |
--- | |
> PUGI__FN const char* xml_parse_result::description() const | |
4767c4799 | |
< xml_document::xml_document(): _buffer(0) | |
--- | |
> PUGI__FN xml_document::xml_document(): _buffer(0) | |
4772c4804 | |
< xml_document::~xml_document() | |
--- | |
> PUGI__FN xml_document::~xml_document() | |
4777c4809 | |
< void xml_document::reset() | |
--- | |
> PUGI__FN void xml_document::reset() | |
4783c4815 | |
< void xml_document::reset(const xml_document& proto) | |
--- | |
> PUGI__FN void xml_document::reset(const xml_document& proto) | |
4791c4823 | |
< void xml_document::create() | |
--- | |
> PUGI__FN void xml_document::create() | |
4794c4826 | |
< STATIC_ASSERT(offsetof(xml_memory_page, data) + sizeof(xml_document_struct) + xml_memory_page_alignment <= sizeof(_memory)); | |
--- | |
> PUGI__STATIC_ASSERT(offsetof(PUGI__NSQ xml_memory_page, data) + sizeof(PUGI__NSQ xml_document_struct) + PUGI__NSQ xml_memory_page_alignment <= sizeof(_memory)); | |
4797c4829 | |
< void* page_memory = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(_memory) + (xml_memory_page_alignment - 1)) & ~(xml_memory_page_alignment - 1)); | |
--- | |
> void* page_memory = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(_memory) + (PUGI__NSQ xml_memory_page_alignment - 1)) & ~(PUGI__NSQ xml_memory_page_alignment - 1)); | |
4800c4832 | |
< xml_memory_page* page = xml_memory_page::construct(page_memory); | |
--- | |
> PUGI__NSQ xml_memory_page* page = PUGI__NSQ xml_memory_page::construct(page_memory); | |
4802c4834 | |
< page->busy_size = xml_memory_page_size; | |
--- | |
> page->busy_size = PUGI__NSQ xml_memory_page_size; | |
4805c4837 | |
< _root = new (page->data) xml_document_struct(page); | |
--- | |
> _root = new (page->data) PUGI__NSQ xml_document_struct(page); | |
4809c4841 | |
< page->allocator = static_cast<xml_document_struct*>(_root); | |
--- | |
> page->allocator = static_cast<PUGI__NSQ xml_document_struct*>(_root); | |
4812c4844 | |
< void xml_document::destroy() | |
--- | |
> PUGI__FN void xml_document::destroy() | |
4817c4849 | |
< global_deallocate(_buffer); | |
--- | |
> PUGI__NSQ xml_memory::deallocate(_buffer); | |
4824c4856 | |
< xml_memory_page* root_page = reinterpret_cast<xml_memory_page*>(_root->header & xml_memory_page_pointer_mask); | |
--- | |
> PUGI__NSQ xml_memory_page* root_page = reinterpret_cast<PUGI__NSQ xml_memory_page*>(_root->header & PUGI__NSQ xml_memory_page_pointer_mask); | |
4828c4860 | |
< for (xml_memory_page* page = root_page->next; page; ) | |
--- | |
> for (PUGI__NSQ xml_memory_page* page = root_page->next; page; ) | |
4830c4862 | |
< xml_memory_page* next = page->next; | |
--- | |
> PUGI__NSQ xml_memory_page* next = page->next; | |
4832c4864 | |
< xml_allocator::deallocate_page(page); | |
--- | |
> PUGI__NSQ xml_allocator::deallocate_page(page); | |
4847c4879 | |
< xml_parse_result xml_document::load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options, xml_encoding encoding) | |
4851c4883 | |
< return load_stream_impl(*this, stream, options, encoding); | |
--- | |
> return PUGI__NSQ load_stream_impl(*this, stream, options, encoding); | |
4854c4886 | |
< xml_parse_result xml_document::load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options) | |
4858c4890 | |
< return load_stream_impl(*this, stream, options, encoding_wchar); | |
--- | |
> return PUGI__NSQ load_stream_impl(*this, stream, options, encoding_wchar); | |
4862c4894 | |
< xml_parse_result xml_document::load(const char_t* contents, unsigned int options) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load(const char_t* contents, unsigned int options) | |
4871c4903 | |
< return load_buffer(contents, strlength(contents) * sizeof(char_t), options, encoding); | |
--- | |
> return load_buffer(contents, PUGI__NSQ strlength(contents) * sizeof(char_t), options, encoding); | |
4874c4906 | |
< xml_parse_result xml_document::load_file(const char* path_, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_file(const char* path_, unsigned int options, xml_encoding encoding) | |
4880c4912 | |
< return load_file_impl(*this, file, options, encoding); | |
--- | |
> return PUGI__NSQ load_file_impl(*this, file, options, encoding); | |
4883c4915 | |
< xml_parse_result xml_document::load_file(const wchar_t* path_, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_file(const wchar_t* path_, unsigned int options, xml_encoding encoding) | |
4887c4919 | |
< FILE* file = open_file_wide(path_, L"rb"); | |
--- | |
> FILE* file = PUGI__NSQ open_file_wide(path_, L"rb"); | |
4889c4921 | |
< return load_file_impl(*this, file, options, encoding); | |
--- | |
> return PUGI__NSQ load_file_impl(*this, file, options, encoding); | |
4892c4924 | |
< xml_parse_result xml_document::load_buffer_impl(void* contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_buffer_impl(void* contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own) | |
4900c4932 | |
< xml_encoding buffer_encoding = get_buffer_encoding(encoding, contents, size); | |
--- | |
> xml_encoding buffer_encoding = PUGI__NSQ get_buffer_encoding(encoding, contents, size); | |
4906c4938 | |
< if (!convert_buffer(buffer, length, buffer_encoding, contents, size, is_mutable)) return make_parse_result(status_out_of_memory); | |
--- | |
> if (!PUGI__NSQ convert_buffer(buffer, length, buffer_encoding, contents, size, is_mutable)) return PUGI__NSQ make_parse_result(status_out_of_memory); | |
4909c4941 | |
< if (own && buffer != contents && contents) global_deallocate(contents); | |
--- | |
> if (own && buffer != contents && contents) PUGI__NSQ xml_memory::deallocate(contents); | |
4912c4944 | |
< xml_parse_result res = xml_parser::parse(buffer, length, _root, options); | |
--- | |
> xml_parse_result res = PUGI__NSQ xml_parser::parse(buffer, length, _root, options); | |
4923c4955 | |
< xml_parse_result xml_document::load_buffer(const void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_buffer(const void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
4928c4960 | |
< xml_parse_result xml_document::load_buffer_inplace(void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_buffer_inplace(void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
4933c4965 | |
< xml_parse_result xml_document::load_buffer_inplace_own(void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
--- | |
> PUGI__FN xml_parse_result xml_document::load_buffer_inplace_own(void* contents, size_t size, unsigned int options, xml_encoding encoding) | |
4938c4970 | |
< void xml_document::save(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
--- | |
> PUGI__FN void xml_document::save(xml_writer& writer, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
4940c4972 | |
< if (flags & format_write_bom) write_bom(writer, get_write_encoding(encoding)); | |
--- | |
> if (flags & format_write_bom) PUGI__NSQ write_bom(writer, PUGI__NSQ get_write_encoding(encoding)); | |
4942c4974 | |
< xml_buffered_writer buffered_writer(writer, encoding); | |
--- | |
> PUGI__NSQ xml_buffered_writer buffered_writer(writer, encoding); | |
4944c4976 | |
< if (!(flags & format_no_declaration) && !has_declaration(*this)) | |
--- | |
> if (!(flags & format_no_declaration) && !PUGI__NSQ has_declaration(*this)) | |
4952c4984 | |
< node_output(buffered_writer, *this, indent, flags, 0); | |
--- | |
> PUGI__NSQ node_output(buffered_writer, *this, indent, flags, 0); | |
4956c4988 | |
< void xml_document::save(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
--- | |
> PUGI__FN void xml_document::save(std::basic_ostream<char, std::char_traits<char> >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
4963c4995 | |
< void xml_document::save(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent, unsigned int flags) const | |
--- | |
> PUGI__FN void xml_document::save(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent, unsigned int flags) const | |
4971c5003 | |
< bool xml_document::save_file(const char* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
--- | |
> PUGI__FN bool xml_document::save_file(const char* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
4984c5016 | |
< bool xml_document::save_file(const wchar_t* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
--- | |
> PUGI__FN bool xml_document::save_file(const wchar_t* path_, const char_t* indent, unsigned int flags, xml_encoding encoding) const | |
4986c5018 | |
< FILE* file = open_file_wide(path_, L"wb"); | |
--- | |
> FILE* file = PUGI__NSQ open_file_wide(path_, L"wb"); | |
4997c5029 | |
< xml_node xml_document::document_element() const | |
--- | |
> PUGI__FN xml_node xml_document::document_element() const | |
5000c5032 | |
< if ((i->header & xml_memory_page_type_mask) + 1 == node_element) | |
--- | |
> if ((i->header & PUGI__NSQ xml_memory_page_type_mask) + 1 == node_element) | |
5007c5039 | |
< std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str) | |
--- | |
> PUGI__FN std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str) | |
5011c5043 | |
< return as_utf8_impl(str, wcslen(str)); | |
--- | |
> return PUGI__NSQ as_utf8_impl(str, wcslen(str)); | |
5014c5046 | |
< std::string PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t>& str) | |
--- | |
> PUGI__FN std::string PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t>& str) | |
5016c5048 | |
< return as_utf8_impl(str.c_str(), str.size()); | |
--- | |
> return PUGI__NSQ as_utf8_impl(str.c_str(), str.size()); | |
5019c5051 | |
< std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const char* str) | |
--- | |
> PUGI__FN std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const char* str) | |
5023c5055 | |
< return as_wide_impl(str, strlen(str)); | |
--- | |
> return PUGI__NSQ as_wide_impl(str, strlen(str)); | |
5026c5058 | |
< std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const std::string& str) | |
--- | |
> PUGI__FN std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const std::string& str) | |
5028c5060 | |
< return as_wide_impl(str.c_str(), str.size()); | |
--- | |
> return PUGI__NSQ as_wide_impl(str.c_str(), str.size()); | |
5032c5064 | |
< void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate) | |
--- | |
> PUGI__FN void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate) | |
5034,5035c5066,5067 | |
< global_allocate = allocate; | |
< global_deallocate = deallocate; | |
--- | |
> PUGI__NSQ xml_memory::allocate = allocate; | |
> PUGI__NSQ xml_memory::deallocate = deallocate; | |
5038c5070 | |
< allocation_function PUGIXML_FUNCTION get_memory_allocation_function() | |
--- | |
> PUGI__FN allocation_function PUGIXML_FUNCTION get_memory_allocation_function() | |
5040c5072 | |
< return global_allocate; | |
--- | |
> return PUGI__NSQ xml_memory::allocate; | |
5043c5075 | |
< deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function() | |
--- | |
> PUGI__FN deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function() | |
5045c5077 | |
< return global_deallocate; | |
--- | |
> return PUGI__NSQ xml_memory::deallocate; | |
5053c5085 | |
< std::bidirectional_iterator_tag _Iter_cat(const xml_node_iterator&) | |
--- | |
> PUGI__FN std::bidirectional_iterator_tag _Iter_cat(const pugi::xml_node_iterator&) | |
5058c5090 | |
< std::bidirectional_iterator_tag _Iter_cat(const xml_attribute_iterator&) | |
--- | |
> PUGI__FN std::bidirectional_iterator_tag _Iter_cat(const pugi::xml_attribute_iterator&) | |
5069c5101 | |
< std::bidirectional_iterator_tag __iterator_category(const xml_node_iterator&) | |
--- | |
> PUGI__FN std::bidirectional_iterator_tag __iterator_category(const pugi::xml_node_iterator&) | |
5074c5106 | |
< std::bidirectional_iterator_tag __iterator_category(const xml_attribute_iterator&) | |
--- | |
> PUGI__FN std::bidirectional_iterator_tag __iterator_category(const pugi::xml_attribute_iterator&) | |
5084c5116 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
5312c5344 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
5356c5388 | |
< xpath_memory_block* block = static_cast<xpath_memory_block*>(global_allocate(block_size)); | |
--- | |
> xpath_memory_block* block = static_cast<xpath_memory_block*>(xml_memory::allocate(block_size)); | |
5421c5453 | |
< global_deallocate(_root->next); | |
--- | |
> xml_memory::deallocate(_root->next); | |
5439c5471 | |
< global_deallocate(cur); | |
--- | |
> xml_memory::deallocate(cur); | |
5458c5490 | |
< global_deallocate(cur); | |
--- | |
> xml_memory::deallocate(cur); | |
5518c5550 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
5645c5677 | |
< xpath_string xpath_string_const(const char_t* str) | |
--- | |
> PUGI__FN xpath_string xpath_string_const(const char_t* str) | |
5651c5683 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
5653c5685 | |
< bool starts_with(const char_t* string, const char_t* pattern) | |
--- | |
> PUGI__FN bool starts_with(const char_t* string, const char_t* pattern) | |
5664c5696 | |
< const char_t* find_char(const char_t* s, char_t c) | |
--- | |
> PUGI__FN const char_t* find_char(const char_t* s, char_t c) | |
5673c5705 | |
< const char_t* find_substring(const char_t* s, const char_t* p) | |
--- | |
> PUGI__FN const char_t* find_substring(const char_t* s, const char_t* p) | |
5684c5716 | |
< char_t tolower_ascii(char_t ch) | |
--- | |
> PUGI__FN char_t tolower_ascii(char_t ch) | |
5689c5721 | |
< xpath_string string_value(const xpath_node& na, xpath_allocator* alloc) | |
--- | |
> PUGI__FN xpath_string string_value(const xpath_node& na, xpath_allocator* alloc) | |
5739c5771 | |
< unsigned int node_height(xml_node n) | |
--- | |
> PUGI__FN unsigned int node_height(xml_node n) | |
5752c5784 | |
< bool node_is_before(xml_node ln, unsigned int lh, xml_node rn, unsigned int rh) | |
--- | |
> PUGI__FN bool node_is_before(xml_node ln, unsigned int lh, xml_node rn, unsigned int rh) | |
5779c5811 | |
< bool node_is_ancestor(xml_node parent, xml_node node) | |
--- | |
> PUGI__FN bool node_is_ancestor(xml_node parent, xml_node node) | |
5786c5818 | |
< const void* document_order(const xpath_node& xnode) | |
--- | |
> PUGI__FN const void* document_order(const xpath_node& xnode) | |
5873c5905 | |
< double gen_nan() | |
--- | |
> PUGI__FN double gen_nan() | |
5886c5918 | |
< bool is_nan(double value) | |
--- | |
> PUGI__FN bool is_nan(double value) | |
5888c5920 | |
< #if defined(MSVC_CRT_VERSION) || defined(__BORLANDC__) | |
--- | |
> #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) | |
5899c5931 | |
< const char_t* convert_number_to_string_special(double value) | |
--- | |
> PUGI__FN const char_t* convert_number_to_string_special(double value) | |
5901c5933 | |
< #if defined(MSVC_CRT_VERSION) || defined(__BORLANDC__) | |
--- | |
> #if defined(PUGI__MSVC_CRT_VERSION) || defined(__BORLANDC__) | |
5931c5963 | |
< bool convert_number_to_boolean(double value) | |
--- | |
> PUGI__FN bool convert_number_to_boolean(double value) | |
5936c5968 | |
< void truncate_zeros(char* begin, char* end) | |
--- | |
> PUGI__FN void truncate_zeros(char* begin, char* end) | |
5944,5945c5976,5977 | |
< #if defined(MSVC_CRT_VERSION) && MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) | |
< void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) | |
--- | |
> #if defined(PUGI__MSVC_CRT_VERSION) && PUGI__MSVC_CRT_VERSION >= 1400 && !defined(_WIN32_WCE) | |
> PUGI__FN void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) | |
5959c5991 | |
< void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) | |
--- | |
> PUGI__FN void convert_number_to_mantissa_exponent(double value, char* buffer, size_t buffer_size, char** out_mantissa, int* out_exponent) | |
5990c6022 | |
< xpath_string convert_number_to_string(double value, xpath_allocator* alloc) | |
--- | |
> PUGI__FN xpath_string convert_number_to_string(double value, xpath_allocator* alloc) | |
6053c6085 | |
< bool check_string_to_number_format(const char_t* string) | |
--- | |
> PUGI__FN bool check_string_to_number_format(const char_t* string) | |
6056c6088 | |
< while (IS_CHARTYPE(*string, ct_space)) ++string; | |
--- | |
> while (PUGI__IS_CHARTYPE(*string, ct_space)) ++string; | |
6064c6096 | |
< if (!IS_CHARTYPEX(string[0], ctx_digit) && (string[0] != '.' || !IS_CHARTYPEX(string[1], ctx_digit))) return false; | |
--- | |
> if (!PUGI__IS_CHARTYPEX(string[0], ctx_digit) && (string[0] != '.' || !PUGI__IS_CHARTYPEX(string[1], ctx_digit))) return false; | |
6067c6099 | |
< while (IS_CHARTYPEX(*string, ctx_digit)) ++string; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*string, ctx_digit)) ++string; | |
6074c6106 | |
< while (IS_CHARTYPEX(*string, ctx_digit)) ++string; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*string, ctx_digit)) ++string; | |
6078c6110 | |
< while (IS_CHARTYPE(*string, ct_space)) ++string; | |
--- | |
> while (PUGI__IS_CHARTYPE(*string, ct_space)) ++string; | |
6083c6115 | |
< double convert_string_to_number(const char_t* string) | |
--- | |
> PUGI__FN double convert_string_to_number(const char_t* string) | |
6096c6128 | |
< bool convert_string_to_number(const char_t* begin, const char_t* end, double* out_result) | |
--- | |
> PUGI__FN bool convert_string_to_number(const char_t* begin, const char_t* end, double* out_result) | |
6106c6138 | |
< scratch = static_cast<char_t*>(global_allocate((length + 1) * sizeof(char_t))); | |
--- | |
> scratch = static_cast<char_t*>(xml_memory::allocate((length + 1) * sizeof(char_t))); | |
6117c6149 | |
< if (scratch != buffer) global_deallocate(scratch); | |
--- | |
> if (scratch != buffer) xml_memory::deallocate(scratch); | |
6122c6154 | |
< double round_nearest(double value) | |
--- | |
> PUGI__FN double round_nearest(double value) | |
6127c6159 | |
< double round_nearest_nzero(double value) | |
--- | |
> PUGI__FN double round_nearest_nzero(double value) | |
6134c6166 | |
< const char_t* qualified_name(const xpath_node& node) | |
--- | |
> PUGI__FN const char_t* qualified_name(const xpath_node& node) | |
6139c6171 | |
< const char_t* local_name(const xpath_node& node) | |
--- | |
> PUGI__FN const char_t* local_name(const xpath_node& node) | |
6170c6202 | |
< const char_t* namespace_uri(const xml_node& node) | |
--- | |
> PUGI__FN const char_t* namespace_uri(const xml_node& node) | |
6188c6220 | |
< const char_t* namespace_uri(const xml_attribute& attr, const xml_node& parent) | |
--- | |
> PUGI__FN const char_t* namespace_uri(const xml_attribute& attr, const xml_node& parent) | |
6209c6241 | |
< const char_t* namespace_uri(const xpath_node& node) | |
--- | |
> PUGI__FN const char_t* namespace_uri(const xpath_node& node) | |
6214c6246 | |
< void normalize_space(char_t* buffer) | |
--- | |
> PUGI__FN void normalize_space(char_t* buffer) | |
6222c6254 | |
< if (IS_CHARTYPE(ch, ct_space)) | |
--- | |
> if (PUGI__IS_CHARTYPE(ch, ct_space)) | |
6225c6257 | |
< while (IS_CHARTYPE(*it, ct_space)) it++; | |
--- | |
> while (PUGI__IS_CHARTYPE(*it, ct_space)) it++; | |
6234c6266 | |
< if (write != buffer && IS_CHARTYPE(write[-1], ct_space)) write--; | |
--- | |
> if (write != buffer && PUGI__IS_CHARTYPE(write[-1], ct_space)) write--; | |
6240c6272 | |
< void translate(char_t* buffer, const char_t* from, const char_t* to) | |
--- | |
> PUGI__FN void translate(char_t* buffer, const char_t* from, const char_t* to) | |
6248c6280 | |
< DMC_VOLATILE char_t ch = *buffer++; | |
--- | |
> PUGI__DMC_VOLATILE char_t ch = *buffer++; | |
6290c6322 | |
< if (value) global_deallocate(value); | |
--- | |
> if (value) xml_memory::deallocate(value); | |
6305c6337 | |
< unsigned int hash_string(const char_t* str) | |
--- | |
> PUGI__FN unsigned int hash_string(const char_t* str) | |
6324c6356 | |
< template <typename T> T* new_xpath_variable(const char_t* name) | |
--- | |
> template <typename T> PUGI__FN T* new_xpath_variable(const char_t* name) | |
6330c6362 | |
< void* memory = global_allocate(sizeof(T) + length * sizeof(char_t)); | |
--- | |
> void* memory = xml_memory::allocate(sizeof(T) + length * sizeof(char_t)); | |
6340c6372 | |
< xpath_variable* new_xpath_variable(xpath_value_type type, const char_t* name) | |
--- | |
> PUGI__FN xpath_variable* new_xpath_variable(xpath_value_type type, const char_t* name) | |
6361c6393 | |
< template <typename T> void delete_xpath_variable(T* var) | |
--- | |
> template <typename T> PUGI__FN void delete_xpath_variable(T* var) | |
6364c6396 | |
< global_deallocate(var); | |
--- | |
> xml_memory::deallocate(var); | |
6367c6399 | |
< void delete_xpath_variable(xpath_value_type type, xpath_variable* var) | |
--- | |
> PUGI__FN void delete_xpath_variable(xpath_value_type type, xpath_variable* var) | |
6392c6424 | |
< xpath_variable* get_variable(xpath_variable_set* set, const char_t* begin, const char_t* end) | |
--- | |
> PUGI__FN xpath_variable* get_variable(xpath_variable_set* set, const char_t* begin, const char_t* end) | |
6402c6434 | |
< scratch = static_cast<char_t*>(global_allocate((length + 1) * sizeof(char_t))); | |
--- | |
> scratch = static_cast<char_t*>(xml_memory::allocate((length + 1) * sizeof(char_t))); | |
6413c6445 | |
< if (scratch != buffer) global_deallocate(scratch); | |
--- | |
> if (scratch != buffer) xml_memory::deallocate(scratch); | |
6420c6452 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
6422c6454 | |
< xpath_node_set::type_t xpath_sort(xpath_node* begin, xpath_node* end, xpath_node_set::type_t type, bool rev) | |
--- | |
> PUGI__FN xpath_node_set::type_t xpath_sort(xpath_node* begin, xpath_node* end, xpath_node_set::type_t type, bool rev) | |
6438c6470 | |
< xpath_node xpath_first(const xpath_node* begin, const xpath_node* end, xpath_node_set::type_t type) | |
--- | |
> PUGI__FN xpath_node xpath_first(const xpath_node* begin, const xpath_node* end, xpath_node_set::type_t type) | |
6457a6490 | |
> | |
6572c6605 | |
< namespace | |
--- | |
> namespace PUGI__NS | |
6655c6688 | |
< while (IS_CHARTYPE(*cur, ct_space)) ++cur; | |
--- | |
> while (PUGI__IS_CHARTYPE(*cur, ct_space)) ++cur; | |
6737c6770 | |
< if (IS_CHARTYPEX(*cur, ctx_start_symbol)) | |
--- | |
> if (PUGI__IS_CHARTYPEX(*cur, ctx_start_symbol)) | |
6741c6774 | |
< while (IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
6743c6776 | |
< if (cur[0] == ':' && IS_CHARTYPEX(cur[1], ctx_symbol)) // qname | |
--- | |
> if (cur[0] == ':' && PUGI__IS_CHARTYPEX(cur[1], ctx_symbol)) // qname | |
6747c6780 | |
< while (IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
6810c6843 | |
< else if (IS_CHARTYPEX(*(cur+1), ctx_digit)) | |
--- | |
> else if (PUGI__IS_CHARTYPEX(*(cur+1), ctx_digit)) | |
6816c6849 | |
< while (IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
6870c6903 | |
< if (IS_CHARTYPEX(*cur, ctx_digit)) | |
--- | |
> if (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) | |
6874c6907 | |
< while (IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
6880c6913 | |
< while (IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_digit)) cur++; | |
6887c6920 | |
< else if (IS_CHARTYPEX(*cur, ctx_start_symbol)) | |
--- | |
> else if (PUGI__IS_CHARTYPEX(*cur, ctx_start_symbol)) | |
6891c6924 | |
< while (IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
6899c6932 | |
< else if (IS_CHARTYPEX(cur[1], ctx_symbol)) // namespace test qname | |
--- | |
> else if (PUGI__IS_CHARTYPEX(cur[1], ctx_symbol)) // namespace test qname | |
6903c6936 | |
< while (IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
--- | |
> while (PUGI__IS_CHARTYPEX(*cur, ctx_symbol)) cur++; | |
9015c9048 | |
< while (IS_CHARTYPE(*state, ct_space)) ++state; | |
--- | |
> while (PUGI__IS_CHARTYPE(*state, ct_space)) ++state; | |
9244c9277 | |
< void* memory = global_allocate(sizeof(xpath_query_impl)); | |
--- | |
> void* memory = xml_memory::allocate(sizeof(xpath_query_impl)); | |
9257c9290 | |
< global_deallocate(ptr); | |
--- | |
> xml_memory::deallocate(ptr); | |
9270c9303 | |
< xpath_string evaluate_string_impl(xpath_query_impl* impl, const xpath_node& n, xpath_stack_data& sd) | |
--- | |
> PUGI__FN xpath_string evaluate_string_impl(xpath_query_impl* impl, const xpath_node& n, xpath_stack_data& sd) | |
9287c9320 | |
< xpath_exception::xpath_exception(const xpath_parse_result& result_): _result(result_) | |
--- | |
> PUGI__FN xpath_exception::xpath_exception(const xpath_parse_result& result_): _result(result_) | |
9292c9325 | |
< const char* xpath_exception::what() const throw() | |
--- | |
> PUGI__FN const char* xpath_exception::what() const throw() | |
9297c9330 | |
< const xpath_parse_result& xpath_exception::result() const | |
--- | |
> PUGI__FN const xpath_parse_result& xpath_exception::result() const | |
9303c9336 | |
< xpath_node::xpath_node() | |
--- | |
> PUGI__FN xpath_node::xpath_node() | |
9307c9340 | |
< xpath_node::xpath_node(const xml_node& node_): _node(node_) | |
--- | |
> PUGI__FN xpath_node::xpath_node(const xml_node& node_): _node(node_) | |
9311c9344 | |
< xpath_node::xpath_node(const xml_attribute& attribute_, const xml_node& parent_): _node(attribute_ ? parent_ : xml_node()), _attribute(attribute_) | |
--- | |
> PUGI__FN xpath_node::xpath_node(const xml_attribute& attribute_, const xml_node& parent_): _node(attribute_ ? parent_ : xml_node()), _attribute(attribute_) | |
9315c9348 | |
< xml_node xpath_node::node() const | |
--- | |
> PUGI__FN xml_node xpath_node::node() const | |
9320c9353 | |
< xml_attribute xpath_node::attribute() const | |
--- | |
> PUGI__FN xml_attribute xpath_node::attribute() const | |
9325c9358 | |
< xml_node xpath_node::parent() const | |
--- | |
> PUGI__FN xml_node xpath_node::parent() const | |
9330c9363 | |
< static void unspecified_bool_xpath_node(xpath_node***) | |
--- | |
> PUGI__FN static void unspecified_bool_xpath_node(xpath_node***) | |
9334c9367 | |
< xpath_node::operator xpath_node::unspecified_bool_type() const | |
--- | |
> PUGI__FN xpath_node::operator xpath_node::unspecified_bool_type() const | |
9339c9372 | |
< bool xpath_node::operator!() const | |
--- | |
> PUGI__FN bool xpath_node::operator!() const | |
9344c9377 | |
< bool xpath_node::operator==(const xpath_node& n) const | |
--- | |
> PUGI__FN bool xpath_node::operator==(const xpath_node& n) const | |
9349c9382 | |
< bool xpath_node::operator!=(const xpath_node& n) const | |
--- | |
> PUGI__FN bool xpath_node::operator!=(const xpath_node& n) const | |
9355c9388 | |
< bool operator&&(const xpath_node& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator&&(const xpath_node& lhs, bool rhs) | |
9360c9393 | |
< bool operator||(const xpath_node& lhs, bool rhs) | |
--- | |
> PUGI__FN bool operator||(const xpath_node& lhs, bool rhs) | |
9366c9399 | |
< void xpath_node_set::_assign(const_iterator begin_, const_iterator end_) | |
--- | |
> PUGI__FN void xpath_node_set::_assign(const_iterator begin_, const_iterator end_) | |
9375c9408 | |
< if (_begin != &_storage) global_deallocate(_begin); | |
--- | |
> if (_begin != &_storage) PUGI__NSQ xml_memory::deallocate(_begin); | |
9386c9419 | |
< xpath_node* storage = static_cast<xpath_node*>(global_allocate(size_ * sizeof(xpath_node))); | |
--- | |
> xpath_node* storage = static_cast<xpath_node*>(PUGI__NSQ xml_memory::allocate(size_ * sizeof(xpath_node))); | |
9400c9433 | |
< if (_begin != &_storage) global_deallocate(_begin); | |
--- | |
> if (_begin != &_storage) PUGI__NSQ xml_memory::deallocate(_begin); | |
9408c9441 | |
< xpath_node_set::xpath_node_set(): _type(type_unsorted), _begin(&_storage), _end(&_storage) | |
--- | |
> PUGI__FN xpath_node_set::xpath_node_set(): _type(type_unsorted), _begin(&_storage), _end(&_storage) | |
9412c9445 | |
< xpath_node_set::xpath_node_set(const_iterator begin_, const_iterator end_, type_t type_): _type(type_), _begin(&_storage), _end(&_storage) | |
--- | |
> PUGI__FN xpath_node_set::xpath_node_set(const_iterator begin_, const_iterator end_, type_t type_): _type(type_), _begin(&_storage), _end(&_storage) | |
9417c9450 | |
< xpath_node_set::~xpath_node_set() | |
--- | |
> PUGI__FN xpath_node_set::~xpath_node_set() | |
9419c9452 | |
< if (_begin != &_storage) global_deallocate(_begin); | |
--- | |
> if (_begin != &_storage) PUGI__NSQ xml_memory::deallocate(_begin); | |
9422c9455 | |
< xpath_node_set::xpath_node_set(const xpath_node_set& ns): _type(ns._type), _begin(&_storage), _end(&_storage) | |
--- | |
> PUGI__FN xpath_node_set::xpath_node_set(const xpath_node_set& ns): _type(ns._type), _begin(&_storage), _end(&_storage) | |
9427c9460 | |
< xpath_node_set& xpath_node_set::operator=(const xpath_node_set& ns) | |
--- | |
> PUGI__FN xpath_node_set& xpath_node_set::operator=(const xpath_node_set& ns) | |
9437c9470 | |
< xpath_node_set::type_t xpath_node_set::type() const | |
--- | |
> PUGI__FN xpath_node_set::type_t xpath_node_set::type() const | |
9442c9475 | |
< size_t xpath_node_set::size() const | |
--- | |
> PUGI__FN size_t xpath_node_set::size() const | |
9447c9480 | |
< bool xpath_node_set::empty() const | |
--- | |
> PUGI__FN bool xpath_node_set::empty() const | |
9452c9485 | |
< const xpath_node& xpath_node_set::operator[](size_t index) const | |
--- | |
> PUGI__FN const xpath_node& xpath_node_set::operator[](size_t index) const | |
9458c9491 | |
< xpath_node_set::const_iterator xpath_node_set::begin() const | |
--- | |
> PUGI__FN xpath_node_set::const_iterator xpath_node_set::begin() const | |
9463c9496 | |
< xpath_node_set::const_iterator xpath_node_set::end() const | |
--- | |
> PUGI__FN xpath_node_set::const_iterator xpath_node_set::end() const | |
9468c9501 | |
< void xpath_node_set::sort(bool reverse) | |
--- | |
> PUGI__FN void xpath_node_set::sort(bool reverse) | |
9470c9503 | |
< _type = xpath_sort(_begin, _end, _type, reverse); | |
--- | |
> _type = PUGI__NSQ xpath_sort(_begin, _end, _type, reverse); | |
9473c9506 | |
< xpath_node xpath_node_set::first() const | |
--- | |
> PUGI__FN xpath_node xpath_node_set::first() const | |
9475c9508 | |
< return xpath_first(_begin, _end, _type); | |
--- | |
> return PUGI__NSQ xpath_first(_begin, _end, _type); | |
9478c9511 | |
< xpath_parse_result::xpath_parse_result(): error("Internal error"), offset(0) | |
--- | |
> PUGI__FN xpath_parse_result::xpath_parse_result(): error("Internal error"), offset(0) | |
9482c9515 | |
< xpath_parse_result::operator bool() const | |
--- | |
> PUGI__FN xpath_parse_result::operator bool() const | |
9486c9519,9520 | |
< const char* xpath_parse_result::description() const | |
--- | |
> | |
> PUGI__FN const char* xpath_parse_result::description() const | |
9491c9525 | |
< xpath_variable::xpath_variable() | |
--- | |
> PUGI__FN xpath_variable::xpath_variable() | |
9495c9529 | |
< const char_t* xpath_variable::name() const | |
--- | |
> PUGI__FN const char_t* xpath_variable::name() const | |
9500c9534 | |
< return static_cast<const xpath_variable_node_set*>(this)->name; | |
--- | |
> return static_cast<const PUGI__NSQ xpath_variable_node_set*>(this)->name; | |
9503c9537 | |
< return static_cast<const xpath_variable_number*>(this)->name; | |
--- | |
> return static_cast<const PUGI__NSQ xpath_variable_number*>(this)->name; | |
9506c9540 | |
< return static_cast<const xpath_variable_string*>(this)->name; | |
--- | |
> return static_cast<const PUGI__NSQ xpath_variable_string*>(this)->name; | |
9509c9543 | |
< return static_cast<const xpath_variable_boolean*>(this)->name; | |
--- | |
> return static_cast<const PUGI__NSQ xpath_variable_boolean*>(this)->name; | |
9517c9551 | |
< xpath_value_type xpath_variable::type() const | |
--- | |
> PUGI__FN xpath_value_type xpath_variable::type() const | |
9522c9556 | |
< bool xpath_variable::get_boolean() const | |
--- | |
> PUGI__FN bool xpath_variable::get_boolean() const | |
9524c9558 | |
< return (_type == xpath_type_boolean) ? static_cast<const xpath_variable_boolean*>(this)->value : false; | |
--- | |
> return (_type == xpath_type_boolean) ? static_cast<const PUGI__NSQ xpath_variable_boolean*>(this)->value : false; | |
9527c9561 | |
< double xpath_variable::get_number() const | |
--- | |
> PUGI__FN double xpath_variable::get_number() const | |
9529c9563 | |
< return (_type == xpath_type_number) ? static_cast<const xpath_variable_number*>(this)->value : gen_nan(); | |
--- | |
> return (_type == xpath_type_number) ? static_cast<const PUGI__NSQ xpath_variable_number*>(this)->value : PUGI__NSQ gen_nan(); | |
9532c9566 | |
< const char_t* xpath_variable::get_string() const | |
--- | |
> PUGI__FN const char_t* xpath_variable::get_string() const | |
9534c9568 | |
< const char_t* value = (_type == xpath_type_string) ? static_cast<const xpath_variable_string*>(this)->value : 0; | |
--- | |
> const char_t* value = (_type == xpath_type_string) ? static_cast<const PUGI__NSQ xpath_variable_string*>(this)->value : 0; | |
9538c9572 | |
< const xpath_node_set& xpath_variable::get_node_set() const | |
--- | |
> PUGI__FN const xpath_node_set& xpath_variable::get_node_set() const | |
9540c9574 | |
< return (_type == xpath_type_node_set) ? static_cast<const xpath_variable_node_set*>(this)->value : dummy_node_set; | |
--- | |
> return (_type == xpath_type_node_set) ? static_cast<const PUGI__NSQ xpath_variable_node_set*>(this)->value : PUGI__NSQ dummy_node_set; | |
9543c9577 | |
< bool xpath_variable::set(bool value) | |
--- | |
> PUGI__FN bool xpath_variable::set(bool value) | |
9547c9581 | |
< static_cast<xpath_variable_boolean*>(this)->value = value; | |
--- | |
> static_cast<PUGI__NSQ xpath_variable_boolean*>(this)->value = value; | |
9551c9585 | |
< bool xpath_variable::set(double value) | |
--- | |
> PUGI__FN bool xpath_variable::set(double value) | |
9555c9589 | |
< static_cast<xpath_variable_number*>(this)->value = value; | |
--- | |
> static_cast<PUGI__NSQ xpath_variable_number*>(this)->value = value; | |
9559c9593 | |
< bool xpath_variable::set(const char_t* value) | |
--- | |
> PUGI__FN bool xpath_variable::set(const char_t* value) | |
9563c9597 | |
< xpath_variable_string* var = static_cast<xpath_variable_string*>(this); | |
--- | |
> PUGI__NSQ xpath_variable_string* var = static_cast<PUGI__NSQ xpath_variable_string*>(this); | |
9566c9600 | |
< size_t size = (strlength(value) + 1) * sizeof(char_t); | |
--- | |
> size_t size = (PUGI__NSQ strlength(value) + 1) * sizeof(char_t); | |
9568c9602 | |
< char_t* copy = static_cast<char_t*>(global_allocate(size)); | |
--- | |
> char_t* copy = static_cast<char_t*>(PUGI__NSQ xml_memory::allocate(size)); | |
9574c9608 | |
< if (var->value) global_deallocate(var->value); | |
--- | |
> if (var->value) PUGI__NSQ xml_memory::deallocate(var->value); | |
9580c9614 | |
< bool xpath_variable::set(const xpath_node_set& value) | |
--- | |
> PUGI__FN bool xpath_variable::set(const xpath_node_set& value) | |
9584c9618 | |
< static_cast<xpath_variable_node_set*>(this)->value = value; | |
--- | |
> static_cast<PUGI__NSQ xpath_variable_node_set*>(this)->value = value; | |
9588c9622 | |
< xpath_variable_set::xpath_variable_set() | |
--- | |
> PUGI__FN xpath_variable_set::xpath_variable_set() | |
9593c9627 | |
< xpath_variable_set::~xpath_variable_set() | |
--- | |
> PUGI__FN xpath_variable_set::~xpath_variable_set() | |
9603c9637 | |
< delete_xpath_variable(var->_type, var); | |
--- | |
> PUGI__NSQ delete_xpath_variable(var->_type, var); | |
9610c9644 | |
< xpath_variable* xpath_variable_set::find(const char_t* name) const | |
--- | |
> PUGI__FN xpath_variable* xpath_variable_set::find(const char_t* name) const | |
9613c9647 | |
< size_t hash = hash_string(name) % hash_size; | |
--- | |
> size_t hash = PUGI__NSQ hash_string(name) % hash_size; | |
9617c9651 | |
< if (strequal(var->name(), name)) | |
--- | |
> if (PUGI__NSQ strequal(var->name(), name)) | |
9623c9657 | |
< xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type) | |
--- | |
> PUGI__FN xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type) | |
9626c9660 | |
< size_t hash = hash_string(name) % hash_size; | |
--- | |
> size_t hash = PUGI__NSQ hash_string(name) % hash_size; | |
9629,9630c9663,9664 | |
< for (xpath_variable* var = _data[hash]; var; var = var->_next) | |
< if (strequal(var->name(), name)) | |
--- | |
> for (PUGI__NSQ xpath_variable* var = _data[hash]; var; var = var->_next) | |
> if (PUGI__NSQ strequal(var->name(), name)) | |
9634c9668 | |
< xpath_variable* result = new_xpath_variable(type, name); | |
--- | |
> PUGI__NSQ xpath_variable* result = PUGI__NSQ new_xpath_variable(type, name); | |
9647c9681 | |
< bool xpath_variable_set::set(const char_t* name, bool value) | |
--- | |
> PUGI__FN bool xpath_variable_set::set(const char_t* name, bool value) | |
9653c9687 | |
< bool xpath_variable_set::set(const char_t* name, double value) | |
--- | |
> PUGI__FN bool xpath_variable_set::set(const char_t* name, double value) | |
9659c9693 | |
< bool xpath_variable_set::set(const char_t* name, const char_t* value) | |
--- | |
> PUGI__FN bool xpath_variable_set::set(const char_t* name, const char_t* value) | |
9665c9699 | |
< bool xpath_variable_set::set(const char_t* name, const xpath_node_set& value) | |
--- | |
> PUGI__FN bool xpath_variable_set::set(const char_t* name, const xpath_node_set& value) | |
9671c9705 | |
< xpath_variable* xpath_variable_set::get(const char_t* name) | |
--- | |
> PUGI__FN xpath_variable* xpath_variable_set::get(const char_t* name) | |
9676c9710 | |
< const xpath_variable* xpath_variable_set::get(const char_t* name) const | |
--- | |
> PUGI__FN const xpath_variable* xpath_variable_set::get(const char_t* name) const | |
9681c9715 | |
< xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables): _impl(0) | |
--- | |
> PUGI__FN xpath_query::xpath_query(const char_t* query, xpath_variable_set* variables): _impl(0) | |
9683c9717 | |
< xpath_query_impl* impl = xpath_query_impl::create(); | |
--- | |
> PUGI__NSQ xpath_query_impl* impl = PUGI__NSQ xpath_query_impl::create(); | |
9695c9729 | |
< buffer_holder impl_holder(impl, xpath_query_impl::destroy); | |
--- | |
> PUGI__NSQ buffer_holder impl_holder(impl, PUGI__NSQ xpath_query_impl::destroy); | |
9697c9731 | |
< impl->root = xpath_parser::parse(query, variables, &impl->alloc, &_result); | |
--- | |
> impl->root = PUGI__NSQ xpath_parser::parse(query, variables, &impl->alloc, &_result); | |
9701c9735 | |
< _impl = static_cast<xpath_query_impl*>(impl_holder.release()); | |
--- | |
> _impl = static_cast<PUGI__NSQ xpath_query_impl*>(impl_holder.release()); | |
9707c9741 | |
< xpath_query::~xpath_query() | |
--- | |
> PUGI__FN xpath_query::~xpath_query() | |
9709c9743 | |
< xpath_query_impl::destroy(_impl); | |
--- | |
> PUGI__NSQ xpath_query_impl::destroy(_impl); | |
9712c9746 | |
< xpath_value_type xpath_query::return_type() const | |
--- | |
> PUGI__FN xpath_value_type xpath_query::return_type() const | |
9716c9750 | |
< return static_cast<xpath_query_impl*>(_impl)->root->rettype(); | |
--- | |
> return static_cast<PUGI__NSQ xpath_query_impl*>(_impl)->root->rettype(); | |
9719c9753 | |
< bool xpath_query::evaluate_boolean(const xpath_node& n) const | |
--- | |
> PUGI__FN bool xpath_query::evaluate_boolean(const xpath_node& n) const | |
9723,9724c9757,9758 | |
< xpath_context c(n, 1, 1); | |
< xpath_stack_data sd; | |
--- | |
> PUGI__NSQ xpath_context c(n, 1, 1); | |
> PUGI__NSQ xpath_stack_data sd; | |
9730c9764 | |
< return static_cast<xpath_query_impl*>(_impl)->root->eval_boolean(c, sd.stack); | |
--- | |
> return static_cast<PUGI__NSQ xpath_query_impl*>(_impl)->root->eval_boolean(c, sd.stack); | |
9733c9767 | |
< double xpath_query::evaluate_number(const xpath_node& n) const | |
--- | |
> PUGI__FN double xpath_query::evaluate_number(const xpath_node& n) const | |
9735c9769 | |
< if (!_impl) return gen_nan(); | |
--- | |
> if (!_impl) return PUGI__NSQ gen_nan(); | |
9737,9738c9771,9772 | |
< xpath_context c(n, 1, 1); | |
< xpath_stack_data sd; | |
--- | |
> PUGI__NSQ xpath_context c(n, 1, 1); | |
> PUGI__NSQ xpath_stack_data sd; | |
9741c9775 | |
< if (setjmp(sd.error_handler)) return gen_nan(); | |
--- | |
> if (setjmp(sd.error_handler)) return PUGI__NSQ gen_nan(); | |
9744c9778 | |
< return static_cast<xpath_query_impl*>(_impl)->root->eval_number(c, sd.stack); | |
--- | |
> return static_cast<PUGI__NSQ xpath_query_impl*>(_impl)->root->eval_number(c, sd.stack); | |
9748c9782 | |
< string_t xpath_query::evaluate_string(const xpath_node& n) const | |
--- | |
> PUGI__FN string_t xpath_query::evaluate_string(const xpath_node& n) const | |
9750c9784 | |
< xpath_stack_data sd; | |
--- | |
> PUGI__NSQ xpath_stack_data sd; | |
9752c9786 | |
< return evaluate_string_impl(static_cast<xpath_query_impl*>(_impl), n, sd).c_str(); | |
--- | |
> return evaluate_string_impl(static_cast<PUGI__NSQ xpath_query_impl*>(_impl), n, sd).c_str(); | |
9756c9790 | |
< size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const | |
--- | |
> PUGI__FN size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const | |
9758c9792 | |
< xpath_stack_data sd; | |
--- | |
> PUGI__NSQ xpath_stack_data sd; | |
9760c9794 | |
< xpath_string r = evaluate_string_impl(static_cast<xpath_query_impl*>(_impl), n, sd); | |
--- | |
> PUGI__NSQ xpath_string r = PUGI__NSQ evaluate_string_impl(static_cast<PUGI__NSQ xpath_query_impl*>(_impl), n, sd); | |
9776c9810 | |
< xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const | |
--- | |
> PUGI__FN xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const | |
9780c9814 | |
< xpath_ast_node* root = static_cast<xpath_query_impl*>(_impl)->root; | |
--- | |
> PUGI__NSQ xpath_ast_node* root = static_cast<PUGI__NSQ xpath_query_impl*>(_impl)->root; | |
9794,9795c9828,9829 | |
< xpath_context c(n, 1, 1); | |
< xpath_stack_data sd; | |
--- | |
> PUGI__NSQ xpath_context c(n, 1, 1); | |
> PUGI__NSQ xpath_stack_data sd; | |
9801c9835 | |
< xpath_node_set_raw r = root->eval_node_set(c, sd.stack); | |
--- | |
> PUGI__NSQ xpath_node_set_raw r = root->eval_node_set(c, sd.stack); | |
9806c9840 | |
< const xpath_parse_result& xpath_query::result() const | |
--- | |
> PUGI__FN const xpath_parse_result& xpath_query::result() const | |
9811c9845 | |
< static void unspecified_bool_xpath_query(xpath_query***) | |
--- | |
> PUGI__FN static void unspecified_bool_xpath_query(xpath_query***) | |
9815c9849 | |
< xpath_query::operator xpath_query::unspecified_bool_type() const | |
--- | |
> PUGI__FN xpath_query::operator xpath_query::unspecified_bool_type() const | |
9820c9854 | |
< bool xpath_query::operator!() const | |
--- | |
> PUGI__FN bool xpath_query::operator!() const | |
9825c9859 | |
< xpath_node xml_node::select_single_node(const char_t* query, xpath_variable_set* variables) const | |
--- | |
> PUGI__FN xpath_node xml_node::select_single_node(const char_t* query, xpath_variable_set* variables) const | |
9831c9865 | |
< xpath_node xml_node::select_single_node(const xpath_query& query) const | |
--- | |
> PUGI__FN xpath_node xml_node::select_single_node(const xpath_query& query) const | |
9837c9871 | |
< xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables) const | |
--- | |
> PUGI__FN xpath_node_set xml_node::select_nodes(const char_t* query, xpath_variable_set* variables) const | |
9843c9877 | |
< xpath_node_set xml_node::select_nodes(const xpath_query& query) const | |
--- | |
> PUGI__FN xpath_node_set xml_node::select_nodes(const xpath_query& query) const | |
9850a9885,9902 | |
> #ifdef __SNC__ | |
> # pragma diag_pop | |
> #endif | |
> | |
> #ifdef __BORLANDC__ | |
> # pragma option pop | |
> #endif | |
> | |
> #ifdef __INTEL_COMPILER | |
> # pragma warning(pop) | |
> #endif | |
> | |
> #ifdef _MSC_VER | |
> # pragma warning(pop) | |
> #endif | |
> | |
> #endif | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment