diff options
Diffstat (limited to 'src/pugixml.hpp')
-rw-r--r-- | src/pugixml.hpp | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp index d59f864..0f79fb7 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -65,7 +65,7 @@ // If the platform is known to have long long support, enable long long functions #ifndef PUGIXML_HAS_LONG_LONG -# if defined(__cplusplus) && __cplusplus >= 201103 +# if __cplusplus >= 201103 # define PUGIXML_HAS_LONG_LONG # elif defined(_MSC_VER) && _MSC_VER >= 1400 # define PUGIXML_HAS_LONG_LONG @@ -203,10 +203,13 @@ namespace pugi // Open file using text mode in xml_document::save_file. This enables special character (i.e. new-line) conversions on some systems. This flag is off by default. const unsigned int format_save_file_text = 0x20; + // Write every attribute on a new line with appropriate indentation. This flag is off by default. + const unsigned int format_indent_attributes = 0x40; + // The default set of formatting flags. // Nodes are indented depending on their depth in DOM tree, a default declaration is output if document has none. const unsigned int format_default = format_indent; - + // Forward declarations struct xml_attribute_struct; struct xml_node_struct; @@ -1040,7 +1043,7 @@ namespace pugi xpath_value_type _type; xpath_variable* _next; - xpath_variable(); + xpath_variable(xpath_value_type type); // Non-copyable semantics xpath_variable(const xpath_variable&); @@ -1072,17 +1075,29 @@ namespace pugi private: xpath_variable* _data[64]; - // Non-copyable semantics - xpath_variable_set(const xpath_variable_set&); - xpath_variable_set& operator=(const xpath_variable_set&); + void _assign(const xpath_variable_set& rhs); + void _swap(xpath_variable_set& rhs); - xpath_variable* find(const char_t* name) const; + xpath_variable* _find(const char_t* name) const; + + static bool _clone(xpath_variable* var, xpath_variable** out_result); + static void _destroy(xpath_variable* var); public: // Default constructor/destructor xpath_variable_set(); ~xpath_variable_set(); + // Copy constructor/assignment operator + xpath_variable_set(const xpath_variable_set& rhs); + xpath_variable_set& operator=(const xpath_variable_set& rhs); + + #if __cplusplus >= 201103 + // Move semantics support + xpath_variable_set(xpath_variable_set&& rhs); + xpath_variable_set& operator=(xpath_variable_set&& rhs); + #endif + // Add a new variable or get the existing one, if the types match xpath_variable* add(const char_t* name, xpath_value_type type); @@ -1115,9 +1130,18 @@ namespace pugi // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors. explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0); + // Constructor + xpath_query(); + // Destructor ~xpath_query(); + #if __cplusplus >= 201103 + // Move semantics support + xpath_query(xpath_query&& rhs); + xpath_query& operator=(xpath_query&& rhs); + #endif + // Get query expression return type xpath_value_type return_type() const; @@ -1253,6 +1277,12 @@ namespace pugi xpath_node_set(const xpath_node_set& ns); xpath_node_set& operator=(const xpath_node_set& ns); + #if __cplusplus >= 201103 + // Move semantics support + xpath_node_set(xpath_node_set&& rhs); + xpath_node_set& operator=(xpath_node_set&& rhs); + #endif + // Get collection type type_t type() const; @@ -1283,7 +1313,8 @@ namespace pugi xpath_node* _begin; xpath_node* _end; - void _assign(const_iterator begin, const_iterator end); + void _assign(const_iterator begin, const_iterator end, type_t type); + void _move(xpath_node_set& rhs); }; #endif |