From 3c75d4d61206e5935622d1ad8d2064ee9cf83da4 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 17 Oct 2018 20:57:34 -0700 Subject: [PATCH] Fix compilation by setting clang-format standard to C++03 --- .clang-format | 1 + src/pugixml.cpp | 18 +++++++++--------- src/pugixml.hpp | 30 +++++++++++++++--------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.clang-format b/.clang-format index e2d5ba7..32b3590 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,4 @@ +Standard: Cpp03 UseTab: ForIndentation TabWidth: 4 IndentWidth: 4 diff --git a/src/pugixml.cpp b/src/pugixml.cpp index df978d1..fb89c59 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -5173,7 +5173,7 @@ struct xml_stream_chunk template PUGI__FN xml_parse_status load_stream_data_noseek(std::basic_istream& stream, void** out_buffer, size_t* out_size) { - auto_deleter> chunks(0, xml_stream_chunk::destroy); + auto_deleter > chunks(0, xml_stream_chunk::destroy); // read file to a chunk list size_t total = 0; @@ -5395,13 +5395,13 @@ PUGI__FN void xml_writer_file::write(const void* data, size_t size) } #ifndef PUGIXML_NO_STL -PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream>& stream) +PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream >& stream) : narrow_stream(&stream) , wide_stream(0) { } -PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream>& stream) +PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream >& stream) : narrow_stream(0) , wide_stream(&stream) { @@ -6754,14 +6754,14 @@ PUGI__FN void xml_node::print(xml_writer& writer, const char_t* indent, unsigned } #ifndef PUGIXML_NO_STL -PUGI__FN void xml_node::print(std::basic_ostream>& stream, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const +PUGI__FN void xml_node::print(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding, unsigned int depth) const { xml_writer_stream writer(stream); print(writer, indent, flags, encoding, depth); } -PUGI__FN void xml_node::print(std::basic_ostream>& stream, const char_t* indent, unsigned int flags, unsigned int depth) const +PUGI__FN void xml_node::print(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, unsigned int depth) const { xml_writer_stream writer(stream); @@ -7588,14 +7588,14 @@ PUGI__FN void xml_document::_move(xml_document& rhs) PUGIXML_NOEXCEPT_IF_NOT_COM #endif #ifndef PUGIXML_NO_STL -PUGI__FN xml_parse_result xml_document::load(std::basic_istream>& stream, unsigned int options, xml_encoding encoding) +PUGI__FN xml_parse_result xml_document::load(std::basic_istream >& stream, unsigned int options, xml_encoding encoding) { reset(); return impl::load_stream_impl(static_cast(_root), stream, options, encoding, &_buffer); } -PUGI__FN xml_parse_result xml_document::load(std::basic_istream>& stream, unsigned int options) +PUGI__FN xml_parse_result xml_document::load(std::basic_istream >& stream, unsigned int options) { reset(); @@ -7692,14 +7692,14 @@ PUGI__FN void xml_document::save(xml_writer& writer, const char_t* indent, unsig } #ifndef PUGIXML_NO_STL -PUGI__FN void xml_document::save(std::basic_ostream>& stream, const char_t* indent, unsigned int flags, xml_encoding encoding) const +PUGI__FN void xml_document::save(std::basic_ostream >& stream, const char_t* indent, unsigned int flags, xml_encoding encoding) const { xml_writer_stream writer(stream); save(writer, indent, flags, encoding); } -PUGI__FN void xml_document::save(std::basic_ostream>& stream, const char_t* indent, unsigned int flags) const +PUGI__FN void xml_document::save(std::basic_ostream >& stream, const char_t* indent, unsigned int flags) const { xml_writer_stream writer(stream); diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 784f8aa..fb40179 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -126,7 +126,7 @@ typedef PUGIXML_CHAR char_t; #ifndef PUGIXML_NO_STL // String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE -typedef std::basic_string, std::allocator> string_t; +typedef std::basic_string, std::allocator > string_t; #endif } // namespace pugi @@ -329,14 +329,14 @@ class PUGIXML_CLASS xml_writer_stream : public xml_writer { public: // Construct writer from an output stream object - xml_writer_stream(std::basic_ostream>& stream); - xml_writer_stream(std::basic_ostream>& stream); + xml_writer_stream(std::basic_ostream >& stream); + xml_writer_stream(std::basic_ostream >& stream); virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE; private: - std::basic_ostream>* narrow_stream; - std::basic_ostream>* wide_stream; + std::basic_ostream >* narrow_stream; + std::basic_ostream >* wide_stream; }; #endif @@ -675,8 +675,8 @@ class PUGIXML_CLASS xml_node #ifndef PUGIXML_NO_STL // Print subtree to stream - void print(std::basic_ostream>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const; - void print(std::basic_ostream>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const; + void print(std::basic_ostream >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const; + void print(std::basic_ostream >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const; #endif // Child nodes iterators @@ -1040,8 +1040,8 @@ class PUGIXML_CLASS xml_document : public xml_node #ifndef PUGIXML_NO_STL // Load document from stream. - xml_parse_result load(std::basic_istream>& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); - xml_parse_result load(std::basic_istream>& stream, unsigned int options = parse_default); + xml_parse_result load(std::basic_istream >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto); + xml_parse_result load(std::basic_istream >& stream, unsigned int options = parse_default); #endif // (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied. @@ -1070,8 +1070,8 @@ class PUGIXML_CLASS xml_document : public xml_node #ifndef PUGIXML_NO_STL // Save XML document to stream (semantics is slightly different from xml_node::print, see documentation for details). - void save(std::basic_ostream>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; - void save(std::basic_ostream>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const; + void save(std::basic_ostream >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const; + void save(std::basic_ostream >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const; #endif // Save XML to file @@ -1407,12 +1407,12 @@ class PUGIXML_CLASS xpath_node_set #ifndef PUGIXML_NO_STL // Convert wide string to UTF8 -std::basic_string, std::allocator> PUGIXML_FUNCTION as_utf8(const wchar_t* str); -std::basic_string, std::allocator> PUGIXML_FUNCTION as_utf8(const std::basic_string, std::allocator>& str); +std::basic_string, std::allocator > PUGIXML_FUNCTION as_utf8(const wchar_t* str); +std::basic_string, std::allocator > PUGIXML_FUNCTION as_utf8(const std::basic_string, std::allocator >& str); // Convert UTF8 to wide string -std::basic_string, std::allocator> PUGIXML_FUNCTION as_wide(const char* str); -std::basic_string, std::allocator> PUGIXML_FUNCTION as_wide(const std::basic_string, std::allocator>& str); +std::basic_string, std::allocator > PUGIXML_FUNCTION as_wide(const char* str); +std::basic_string, std::allocator > PUGIXML_FUNCTION as_wide(const std::basic_string, std::allocator >& str); #endif // Memory allocation function interface; returns pointer to allocated memory or NULL on failure