Skip to content

Commit

Permalink
Import original pugixml library again...
Browse files Browse the repository at this point in the history
... leaving out the changes in the namespace statements made in the last few days.
  • Loading branch information
teusbenschop committed Apr 21, 2024
1 parent 361b2fd commit f0da88a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
18 changes: 9 additions & 9 deletions pugixml/pugixml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,7 +2386,7 @@ PUGI__NS_BEGIN
}

template <typename String, typename Header>
PUGI__FN bool strcpy_insitu(std::string& dest, Header& header, uintptr_t header_mask, const char_t* source, size_t source_length)
PUGI__FN bool strcpy_insitu(String& dest, Header& header, uintptr_t header_mask, const char_t* source, size_t source_length)
{
if (source_length == 0)
{
Expand Down Expand Up @@ -4420,7 +4420,7 @@ PUGI__NS_BEGIN
}

template <typename String, typename Header>
PUGI__FN void node_copy_string(std::string& dest, Header& header, uintptr_t header_mask, char_t* source, Header& source_header, xml_allocator* alloc)
PUGI__FN void node_copy_string(String& dest, Header& header, uintptr_t header_mask, char_t* source, Header& source_header, xml_allocator* alloc)
{
assert(!dest && (header & header_mask) == 0);

Expand Down Expand Up @@ -4680,7 +4680,7 @@ PUGI__NS_BEGIN

// set value with conversion functions
template <typename String, typename Header>
PUGI__FN bool set_value_ascii(std::string& dest, Header& header, uintptr_t header_mask, char* buf)
PUGI__FN bool set_value_ascii(String& dest, Header& header, uintptr_t header_mask, char* buf)
{
#ifdef PUGIXML_WCHAR_MODE
char_t wbuf[128];
Expand All @@ -4696,7 +4696,7 @@ PUGI__NS_BEGIN
}

template <typename U, typename String, typename Header>
PUGI__FN bool set_value_integer(std::string& dest, Header& header, uintptr_t header_mask, U value, bool negative)
PUGI__FN bool set_value_integer(String& dest, Header& header, uintptr_t header_mask, U value, bool negative)
{
char_t buf[64];
char_t* end = buf + sizeof(buf) / sizeof(buf[0]);
Expand All @@ -4706,7 +4706,7 @@ PUGI__NS_BEGIN
}

template <typename String, typename Header>
PUGI__FN bool set_value_convert(std::string& dest, Header& header, uintptr_t header_mask, float value, int precision)
PUGI__FN bool set_value_convert(String& dest, Header& header, uintptr_t header_mask, float value, int precision)
{
char buf[128];
PUGI__SNPRINTF(buf, "%.*g", precision, double(value));
Expand All @@ -4715,7 +4715,7 @@ PUGI__NS_BEGIN
}

template <typename String, typename Header>
PUGI__FN bool set_value_convert(std::string& dest, Header& header, uintptr_t header_mask, double value, int precision)
PUGI__FN bool set_value_convert(String& dest, Header& header, uintptr_t header_mask, double value, int precision)
{
char buf[128];
PUGI__SNPRINTF(buf, "%.*g", precision, value);
Expand All @@ -4724,7 +4724,7 @@ PUGI__NS_BEGIN
}

template <typename String, typename Header>
PUGI__FN bool set_value_bool(std::string& dest, Header& header, uintptr_t header_mask, bool value)
PUGI__FN bool set_value_bool(String& dest, Header& header, uintptr_t header_mask, bool value)
{
return strcpy_insitu(dest, header, header_mask, value ? PUGIXML_TEXT("true") : PUGIXML_TEXT("false"), value ? 4 : 5);
}
Expand Down Expand Up @@ -9599,7 +9599,7 @@ PUGI__NS_BEGIN
ast_func_namespace_uri_1, // namespace-uri(left)
ast_func_name_0, // name()
ast_func_name_1, // name(left)
ast_func_string_0, // std::string()
ast_func_string_0, // string()
ast_func_string_1, // string(left)
ast_func_concat, // concat(left, right, siblings)
ast_func_starts_with, // starts_with(left, right)
Expand Down Expand Up @@ -12042,7 +12042,7 @@ PUGI__NS_BEGIN
// PathExpr begins with either LocationPath or FilterExpr.
// FilterExpr begins with PrimaryExpr
// PrimaryExpr begins with '$' in case of it being a variable reference,
// '(' in case of it being an expression, std::string literal, number constant or
// '(' in case of it being an expression, string literal, number constant or
// function call.
if (_lexer.current() == lex_var_ref || _lexer.current() == lex_open_brace ||
_lexer.current() == lex_quoted_string || _lexer.current() == lex_number ||
Expand Down
7 changes: 1 addition & 6 deletions pugixml/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,15 @@
#pragma GCC diagnostic ignored "-Wsuggest-override"
#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#ifndef HAVE_PUGIXML
#ifndef HAVE_PUGIXML
#include <pugixml/pugixml.hpp>
#endif
#ifdef HAVE_PUGIXML
#include <pugixml.hpp>
#endif
#endif
#ifdef HAVE_PUGIXML
#include <pugixml.hpp>
#endif
#pragma GCC diagnostic pop


void pugixml_utils_error_logger (void * pugi_xml_parse_result, const std::string& xml)
void pugixml_utils_error_logger (void * pugi_xml_parse_result, const std::string & xml)
{
pugi::xml_parse_result * result = static_cast<pugi::xml_parse_result *>(pugi_xml_parse_result);
if (result->status == pugi::status_ok) return;
Expand Down

0 comments on commit f0da88a

Please sign in to comment.