1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-11-19 15:47:18 +01:00

Update libraries and make it build on windows.

Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
Sandu Liviu Catalin
2025-06-25 22:34:23 +03:00
parent 520a5eacc5
commit f2b7499f85
3038 changed files with 251668 additions and 273857 deletions

View File

@@ -1,20 +1,18 @@
/**
* pugixml parser - version 1.11
* pugixml parser - version 1.15
* --------------------------------------------------------
* Copyright (C) 2006-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at https://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
* of this file.
* SPDX-FileCopyrightText: Copyright (C) 2006-2025, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* SPDX-License-Identifier: MIT
*
* This work is based on the pugxml parser, which is:
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
* See LICENSE.md or notice at the end of this file.
*/
#ifndef PUGIXML_VERSION
// Define version macro; evaluates to major * 1000 + minor * 10 + patch so that it's safe to use in less-than comparisons
// Note: pugixml used major * 100 + minor * 10 + patch format up until 1.9 (which had version identifier 190); starting from pugixml 1.10, the minor version number is two digits
# define PUGIXML_VERSION 1110
#ifndef PUGIXML_VERSION
# define PUGIXML_VERSION 1150 // 1.15
#endif
// Include user configuration file (this can define various configuration macros)
@@ -38,6 +36,20 @@
# include <string>
#endif
// Check if std::string_view is available
#if !defined(PUGIXML_HAS_STRING_VIEW) && !defined(PUGIXML_NO_STL)
# if __cplusplus >= 201703L
# define PUGIXML_HAS_STRING_VIEW
# elif defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
# define PUGIXML_HAS_STRING_VIEW
# endif
#endif
// Include string_view if appropriate
#ifdef PUGIXML_HAS_STRING_VIEW
# include <string_view>
#endif
// Macro for deprecated features
#ifndef PUGIXML_DEPRECATED
# if defined(__GNUC__)
@@ -82,14 +94,14 @@
# endif
#endif
// If C++ is 2011 or higher, add 'noexcept' specifiers
// If C++ is 2011 or higher, use 'noexcept' specifiers
#ifndef PUGIXML_NOEXCEPT
# if __cplusplus >= 201103
# define PUGIXML_NOEXCEPT noexcept
# elif defined(_MSC_VER) && _MSC_VER >= 1900
# define PUGIXML_NOEXCEPT noexcept
# else
# define PUGIXML_NOEXCEPT
# define PUGIXML_NOEXCEPT throw()
# endif
#endif
@@ -115,6 +127,8 @@
#ifndef PUGIXML_NULL
# if __cplusplus >= 201103
# define PUGIXML_NULL nullptr
# elif defined(_MSC_VER) && _MSC_VER >= 1600
# define PUGIXML_NULL nullptr
# else
# define PUGIXML_NULL 0
# endif
@@ -136,7 +150,12 @@ namespace pugi
#ifndef PUGIXML_NO_STL
// String type used for operations that work with STL string; depends on PUGIXML_WCHAR_MODE
typedef std::basic_string<PUGIXML_CHAR, std::char_traits<PUGIXML_CHAR>, std::allocator<PUGIXML_CHAR> > string_t;
typedef std::basic_string<PUGIXML_CHAR> string_t;
#endif
#ifdef PUGIXML_HAS_STRING_VIEW
// String view type used for operations that can work with a length delimited string; depends on PUGIXML_WCHAR_MODE
typedef std::basic_string_view<PUGIXML_CHAR> string_view_t;
#endif
}
@@ -211,6 +230,10 @@ namespace pugi
// This flag is off by default.
const unsigned int parse_embed_pcdata = 0x2000;
// This flag determines whether determines whether the the two pcdata should be merged or not, if no intermediatory data are parsed in the document.
// This flag is off by default.
const unsigned int parse_merge_pcdata = 0x4000;
// The default parsing mode.
// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
@@ -322,7 +345,7 @@ namespace pugi
class PUGIXML_CLASS xml_writer
{
public:
virtual ~xml_writer() {}
virtual ~xml_writer();
// Write memory chunk into stream/file/whatever
virtual void write(const void* data, size_t size) = 0;
@@ -347,14 +370,14 @@ namespace pugi
{
public:
// Construct writer from an output stream object
xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream);
xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream);
xml_writer_stream(std::basic_ostream<char>& stream);
xml_writer_stream(std::basic_ostream<wchar_t>& stream);
virtual void write(const void* data, size_t size) PUGIXML_OVERRIDE;
private:
std::basic_ostream<char, std::char_traits<char> >* narrow_stream;
std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream;
std::basic_ostream<char>* narrow_stream;
std::basic_ostream<wchar_t>* wide_stream;
};
#endif
@@ -390,7 +413,7 @@ namespace pugi
bool operator<=(const xml_attribute& r) const;
bool operator>=(const xml_attribute& r) const;
// Check if attribute is empty
// Check if attribute is empty (null)
bool empty() const;
// Get attribute name/value, or "" if attribute is empty
@@ -416,7 +439,15 @@ namespace pugi
// Set attribute name/value (returns false if attribute is empty or there is not enough memory)
bool set_name(const char_t* rhs);
bool set_name(const char_t* rhs, size_t size);
#ifdef PUGIXML_HAS_STRING_VIEW
bool set_name(string_view_t rhs);
#endif
bool set_value(const char_t* rhs);
bool set_value(const char_t* rhs, size_t size);
#ifdef PUGIXML_HAS_STRING_VIEW
bool set_value(string_view_t rhs);
#endif
// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
bool set_value(int rhs);
@@ -444,6 +475,10 @@ namespace pugi
xml_attribute& operator=(float rhs);
xml_attribute& operator=(bool rhs);
#ifdef PUGIXML_HAS_STRING_VIEW
xml_attribute& operator=(string_view_t rhs);
#endif
#ifdef PUGIXML_HAS_LONG_LONG
xml_attribute& operator=(long long rhs);
xml_attribute& operator=(unsigned long long rhs);
@@ -499,7 +534,7 @@ namespace pugi
bool operator<=(const xml_node& r) const;
bool operator>=(const xml_node& r) const;
// Check if node is empty.
// Check if node is empty (null)
bool empty() const;
// Get node type
@@ -538,9 +573,18 @@ namespace pugi
xml_attribute attribute(const char_t* name) const;
xml_node next_sibling(const char_t* name) const;
xml_node previous_sibling(const char_t* name) const;
#ifdef PUGIXML_HAS_STRING_VIEW
xml_node child(string_view_t name) const;
xml_attribute attribute(string_view_t name) const;
xml_node next_sibling(string_view_t name) const;
xml_node previous_sibling(string_view_t name) const;
#endif
// Get attribute, starting the search from a hint (and updating hint so that searching for a sequence of attributes is fast)
xml_attribute attribute(const char_t* name, xml_attribute& hint) const;
#ifdef PUGIXML_HAS_STRING_VIEW
xml_attribute attribute(string_view_t name, xml_attribute& hint) const;
#endif
// Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
const char_t* child_value() const;
@@ -550,13 +594,27 @@ namespace pugi
// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
bool set_name(const char_t* rhs);
bool set_name(const char_t* rhs, size_t size);
#ifdef PUGIXML_HAS_STRING_VIEW
bool set_name(string_view_t rhs);
#endif
bool set_value(const char_t* rhs);
bool set_value(const char_t* rhs, size_t size);
#ifdef PUGIXML_HAS_STRING_VIEW
bool set_value(string_view_t rhs);
#endif
// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
xml_attribute append_attribute(const char_t* name);
xml_attribute prepend_attribute(const char_t* name);
xml_attribute insert_attribute_after(const char_t* name, const xml_attribute& attr);
xml_attribute insert_attribute_before(const char_t* name, const xml_attribute& attr);
#ifdef PUGIXML_HAS_STRING_VIEW
xml_attribute append_attribute(string_view_t name);
xml_attribute prepend_attribute(string_view_t name);
xml_attribute insert_attribute_after(string_view_t name, const xml_attribute& attr);
xml_attribute insert_attribute_before(string_view_t name, const xml_attribute& attr);
#endif
// Add a copy of the specified attribute. Returns added attribute, or empty attribute on errors.
xml_attribute append_copy(const xml_attribute& proto);
@@ -575,6 +633,12 @@ namespace pugi
xml_node prepend_child(const char_t* name);
xml_node insert_child_after(const char_t* name, const xml_node& node);
xml_node insert_child_before(const char_t* name, const xml_node& node);
#ifdef PUGIXML_HAS_STRING_VIEW
xml_node append_child(string_view_t name);
xml_node prepend_child(string_view_t name);
xml_node insert_child_after(string_view_t, const xml_node& node);
xml_node insert_child_before(string_view_t name, const xml_node& node);
#endif
// Add a copy of the specified node as a child. Returns added node, or empty node on errors.
xml_node append_copy(const xml_node& proto);
@@ -591,6 +655,9 @@ namespace pugi
// Remove specified attribute
bool remove_attribute(const xml_attribute& a);
bool remove_attribute(const char_t* name);
#ifdef PUGIXML_HAS_STRING_VIEW
bool remove_attribute(string_view_t name);
#endif
// Remove all attributes
bool remove_attributes();
@@ -598,6 +665,9 @@ namespace pugi
// Remove specified child
bool remove_child(const xml_node& n);
bool remove_child(const char_t* name);
#ifdef PUGIXML_HAS_STRING_VIEW
bool remove_child(string_view_t name);
#endif
// Remove all children
bool remove_children();
@@ -690,8 +760,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL
// Print subtree to stream
void print(std::basic_ostream<char, std::char_traits<char> >& 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<wchar_t, std::char_traits<wchar_t> >& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const;
void print(std::basic_ostream<char>& 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<wchar_t>& os, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, unsigned int depth = 0) const;
#endif
// Child nodes iterators
@@ -708,9 +778,12 @@ namespace pugi
// Range-based for support
xml_object_range<xml_node_iterator> children() const;
xml_object_range<xml_named_node_iterator> children(const char_t* name) const;
xml_object_range<xml_attribute_iterator> attributes() const;
// Range-based for support for all children with the specified name
// Note: name pointer must have a longer lifetime than the returned object; be careful with passing temporaries!
xml_object_range<xml_named_node_iterator> children(const char_t* name) const;
// Get node offset in parsed file/string (in char_t units) for debugging purposes
ptrdiff_t offset_debug() const;
@@ -751,7 +824,7 @@ namespace pugi
// Borland C++ workaround
bool operator!() const;
// Check if text object is empty
// Check if text object is empty (null)
bool empty() const;
// Get text, or "" if object is empty
@@ -776,6 +849,10 @@ namespace pugi
// Set text (returns false if object is empty or there is not enough memory)
bool set(const char_t* rhs);
bool set(const char_t* rhs, size_t size);
#ifdef PUGIXML_HAS_STRING_VIEW
bool set(string_view_t rhs);
#endif
// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
bool set(int rhs);
@@ -803,6 +880,10 @@ namespace pugi
xml_text& operator=(float rhs);
xml_text& operator=(bool rhs);
#ifdef PUGIXML_HAS_STRING_VIEW
xml_text& operator=(string_view_t rhs);
#endif
#ifdef PUGIXML_HAS_LONG_LONG
xml_text& operator=(long long rhs);
xml_text& operator=(unsigned long long rhs);
@@ -922,6 +1003,7 @@ namespace pugi
xml_named_node_iterator();
// Construct an iterator which points to the specified node
// Note: name pointer is stored in the iterator and must have a longer lifetime than iterator itself
xml_named_node_iterator(const xml_node& node, const char_t* name);
// Iterator operators
@@ -1057,8 +1139,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL
// Load document from stream.
xml_parse_result load(std::basic_istream<char, std::char_traits<char> >& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
xml_parse_result load(std::basic_istream<wchar_t, std::char_traits<wchar_t> >& stream, unsigned int options = parse_default);
xml_parse_result load(std::basic_istream<char>& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
xml_parse_result load(std::basic_istream<wchar_t>& stream, unsigned int options = parse_default);
#endif
// (deprecated: use load_string instead) Load document from zero-terminated string. No encoding conversions are applied.
@@ -1087,8 +1169,8 @@ namespace pugi
#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<char, std::char_traits<char> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
void save(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const;
void save(std::basic_ostream<char>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
void save(std::basic_ostream<wchar_t>& stream, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default) const;
#endif
// Save XML to file
@@ -1299,7 +1381,7 @@ namespace pugi
explicit xpath_exception(const xpath_parse_result& result);
// Get error message
virtual const char* what() const throw() PUGIXML_OVERRIDE;
virtual const char* what() const PUGIXML_NOEXCEPT PUGIXML_OVERRIDE;
// Get parse result
const xpath_parse_result& result() const;
@@ -1424,12 +1506,12 @@ namespace pugi
#ifndef PUGIXML_NO_STL
// Convert wide string to UTF8
std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
std::basic_string<char> PUGIXML_FUNCTION as_utf8(const wchar_t* str);
std::basic_string<char> PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t>& str);
// Convert UTF8 to wide string
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const char* str);
std::basic_string<wchar_t> PUGIXML_FUNCTION as_wide(const std::basic_string<char>& str);
#endif
// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
@@ -1476,7 +1558,7 @@ namespace std
#endif
/**
* Copyright (c) 2006-2020 Arseny Kapoulkine
* Copyright (c) 2006-2025 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation

File diff suppressed because it is too large Load Diff