diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
new file mode 100644
index 0000000000..75d19353b6
--- /dev/null
+++ b/.git-blame-ignore-revs
@@ -0,0 +1,9 @@
+# Massive EOL normalization & 'svn:eol-style native' flag setting for all txt/conf/h/c files.
+# https://github.com/rathena/rathena/commit/637ae9a4dcde0d5885a18841d2f3875e06893c30
+637ae9a4dcde0d5885a18841d2f3875e06893c30
+# Applied AStyle code formating as discussed on tid:74602.
+# https://github.com/rathena/rathena/commit/a7c32653f70bd420bdf5a621acdf3aea5c6e6002
+a7c32653f70bd420bdf5a621acdf3aea5c6e6002
+# Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).
+# https://github.com/rathena/rathena/commit/a2bdc47dafb32f6d18ed350d8bbe79b8f679a049
+a2bdc47dafb32f6d18ed350d8bbe79b8f679a049
diff --git a/.github/workflows/build_servers_gcc.yml b/.github/workflows/build_servers_gcc.yml
index 91f92c0160..cc0851712d 100644
--- a/.github/workflows/build_servers_gcc.yml
+++ b/.github/workflows/build_servers_gcc.yml
@@ -31,7 +31,7 @@ jobs:
# Available: ubuntu-22.04, ubuntu-20.04
os: [ubuntu-latest]
# Older versions of GCC are not available via unaltered aptitude repo lists.
- gcc: ['9', '10', '11']
+ gcc: ['9', '10', '11', '12', '13']
steps:
- uses: actions/checkout@v2
diff --git a/3rdparty/README.txt b/3rdparty/README.txt
index 4c23fb9cf1..cbb3671592 100644
--- a/3rdparty/README.txt
+++ b/3rdparty/README.txt
@@ -7,3 +7,4 @@ mysql - library for MySQL Community Server (http://www.mysql.com)
pcre - library for Perl Compatible Regular Expressions (http://www.pcre.org)
zlib - library for DEFLATE lossless compression algorithm (http://www.zlib.net)
json - library for nlohmann json (https://github.com/nlohmann/json/tree/4b2c8ce6bcfe7f39f2bb9e680c1e7a4d67c2dd48)
+yaml-cpp - library for yaml (https://github.com/jbeder/yaml-cpp/tree/0e6e28d1a38224fc8172fae0109ea7f673c096db)
diff --git a/3rdparty/httplib/httplib.vcxproj b/3rdparty/httplib/httplib.vcxproj
index 5db9ff5de9..0c597b353b 100644
--- a/3rdparty/httplib/httplib.vcxproj
+++ b/3rdparty/httplib/httplib.vcxproj
@@ -98,6 +98,7 @@
Disabled
_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
MultiThreadedDebug
+ true
Windows
@@ -112,6 +113,7 @@
Disabled
_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
MultiThreadedDebug
+ true
Windows
@@ -128,6 +130,7 @@
true
_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
MultiThreaded
+ true
Windows
@@ -146,6 +149,7 @@
true
_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_LIB;%(PreprocessorDefinitions)
MultiThreaded
+ true
Windows
diff --git a/3rdparty/libconfig/libconfig.vcxproj b/3rdparty/libconfig/libconfig.vcxproj
index 1277142bb6..457f08a552 100644
--- a/3rdparty/libconfig/libconfig.vcxproj
+++ b/3rdparty/libconfig/libconfig.vcxproj
@@ -108,6 +108,7 @@
Disabled
YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
MultiThreadedDebug
+ true
Windows
@@ -122,6 +123,7 @@
Disabled
YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
MultiThreadedDebug
+ true
Windows
@@ -138,6 +140,7 @@
true
YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
MultiThreaded
+ true
Windows
@@ -156,6 +159,7 @@
true
YY_USE_CONST;LIBCONFIG_STATIC;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;_LIB;%(PreprocessorDefinitions)
MultiThreaded
+ true
Windows
diff --git a/3rdparty/libconfig/scanner.c b/3rdparty/libconfig/scanner.c
index a7a401af50..09b8ec2a5e 100644
--- a/3rdparty/libconfig/scanner.c
+++ b/3rdparty/libconfig/scanner.c
@@ -2,6 +2,11 @@
#line 4 "scanner.c"
+#ifdef _MSC_VER
+ #pragma warning( push )
+ #pragma warning( disable : 4267 )
+#endif
+
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
@@ -2365,3 +2370,7 @@ void libconfig_yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
#line 192 "scanner.l"
+
+#ifdef _MSC_VER
+ #pragma warning( pop )
+#endif
diff --git a/3rdparty/rapidyaml/ryml.vcxproj b/3rdparty/rapidyaml/ryml.vcxproj
index f0c0b20896..839016d6ee 100644
--- a/3rdparty/rapidyaml/ryml.vcxproj
+++ b/3rdparty/rapidyaml/ryml.vcxproj
@@ -103,6 +103,7 @@
WIN32;_WINDOWS;CMAKE_INTDIR="Debug";_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
$(IntDir)
stdcpp17
+ true
WIN32;_DEBUG;_WINDOWS;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions)
@@ -138,6 +139,7 @@
WIN32;_WINDOWS;CMAKE_INTDIR="Debug";_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)
$(IntDir)
stdcpp17
+ true
WIN32;_DEBUG;_WINDOWS;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions)
@@ -173,6 +175,7 @@
stdcpp17
+ true
WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions)
@@ -208,6 +211,7 @@
stdcpp17
+ true
WIN32;_WINDOWS;NDEBUG;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions)
diff --git a/3rdparty/yaml-cpp/CMakeLists.txt b/3rdparty/yaml-cpp/CMakeLists.txt
index b2821b67f1..e14af4edca 100644
--- a/3rdparty/yaml-cpp/CMakeLists.txt
+++ b/3rdparty/yaml-cpp/CMakeLists.txt
@@ -21,6 +21,7 @@ set( YAML_HEADERS
"${YAML_INCLUDE_DIRS}/yaml-cpp/ostream_wrapper.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/null.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/noncopyable.h"
+ "${YAML_INCLUDE_DIRS}/yaml-cpp/noexcept.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/mark.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/exceptions.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/eventhandler.h"
@@ -30,6 +31,7 @@ set( YAML_HEADERS
"${YAML_INCLUDE_DIRS}/yaml-cpp/emitterdef.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/emitfromevents.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/dll.h"
+ "${YAML_INCLUDE_DIRS}/yaml-cpp/depthguard.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/binary.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/anchor.h"
"${YAML_INCLUDE_DIRS}/yaml-cpp/node/type.h"
@@ -46,6 +48,7 @@ set( YAML_HEADERS
set( YAML_SOURCES
"${YAML_SOURCE_DIR}/binary.cpp"
"${YAML_SOURCE_DIR}/convert.cpp"
+ "${YAML_SOURCE_DIR}/depthguard.cpp"
"${YAML_SOURCE_DIR}/directives.cpp"
"${YAML_SOURCE_DIR}/emit.cpp"
"${YAML_SOURCE_DIR}/emitfromevents.cpp"
@@ -81,3 +84,4 @@ set( YAML_DEFINITIONS
include_directories(${YAML_INCLUDE_DIRS} ${YAML_SOURCE_DIR})
#message(STATUS "YAML_INCLUDE_DIRS : ${YAML_INCLUDE_DIRS}, YAML_SOURCE_DIR=${YAML_SOURCE_DIR}")
ADD_LIBRARY(${this_target} STATIC ${YAML_SOURCES} )
+target_compile_definitions(${this_target} PUBLIC "-DYAML_CPP_STATIC_DEFINE")
diff --git a/3rdparty/yaml-cpp/Makefile.in b/3rdparty/yaml-cpp/Makefile.in
index 29ca15129b..e7fa56075d 100644
--- a/3rdparty/yaml-cpp/Makefile.in
+++ b/3rdparty/yaml-cpp/Makefile.in
@@ -4,7 +4,7 @@ YAML_CPP_DIR_OBJ = $(YAML_CPP_OBJ:%=obj/%)
YAML_CPP_H = $(shell find * -type f -name "*.h")
YAML_CPP_AR = obj/yaml-cpp.a
-CXXFLAG =-std=c++11
+CXXFLAG =-std=c++17 -DYAML_CPP_STATIC_DEFINE
INC=-Iinclude
@SET_MAKE@
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h b/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h
index 06759c724d..f46d1d79dd 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/anchor.h
@@ -10,7 +10,7 @@
#include
namespace YAML {
-typedef std::size_t anchor_t;
+using anchor_t = std::size_t;
const anchor_t NullAnchor = 0;
}
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/binary.h b/3rdparty/yaml-cpp/include/yaml-cpp/binary.h
index 29d5dbd027..1050dae98c 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/binary.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/binary.h
@@ -19,9 +19,13 @@ YAML_CPP_API std::vector DecodeBase64(const std::string &input);
class YAML_CPP_API Binary {
public:
- Binary() : m_unownedData(0), m_unownedSize(0) {}
Binary(const unsigned char *data_, std::size_t size_)
- : m_unownedData(data_), m_unownedSize(size_) {}
+ : m_data{}, m_unownedData(data_), m_unownedSize(size_) {}
+ Binary() : Binary(nullptr, 0) {}
+ Binary(const Binary &) = default;
+ Binary(Binary &&) = default;
+ Binary &operator=(const Binary &) = default;
+ Binary &operator=(Binary &&) = default;
bool owned() const { return !m_unownedData; }
std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; }
@@ -35,7 +39,7 @@ class YAML_CPP_API Binary {
rhs.clear();
rhs.resize(m_unownedSize);
std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin());
- m_unownedData = 0;
+ m_unownedData = nullptr;
m_unownedSize = 0;
} else {
m_data.swap(rhs);
@@ -62,6 +66,6 @@ class YAML_CPP_API Binary {
const unsigned char *m_unownedData;
std::size_t m_unownedSize;
};
-}
+} // namespace YAML
#endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h b/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h
index 78db9ec928..1b7809b875 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/contrib/anchordict.h
@@ -22,6 +22,7 @@ namespace YAML {
template
class AnchorDict {
public:
+ AnchorDict() : m_data{} {}
void Register(anchor_t anchor, T value) {
if (anchor > m_data.size()) {
m_data.resize(anchor);
@@ -34,6 +35,6 @@ class AnchorDict {
private:
std::vector m_data;
};
-}
+} // namespace YAML
#endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h b/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h
index 7c2159b465..dbffd921e6 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/contrib/graphbuilder.h
@@ -15,10 +15,12 @@ class Parser;
// GraphBuilderInterface
// . Abstraction of node creation
-// . pParentNode is always NULL or the return value of one of the NewXXX()
+// . pParentNode is always nullptr or the return value of one of the NewXXX()
// functions.
class GraphBuilderInterface {
public:
+ virtual ~GraphBuilderInterface() = 0;
+
// Create and return a new node with a null value.
virtual void *NewNull(const Mark &mark, void *pParentNode) = 0;
@@ -71,9 +73,9 @@ class GraphBuilder : public GraphBuilderInterface {
typedef typename Impl::Map Map;
GraphBuilder(Impl &impl) : m_impl(impl) {
- Map *pMap = NULL;
- Sequence *pSeq = NULL;
- Node *pNode = NULL;
+ Map *pMap = nullptr;
+ Sequence *pSeq = nullptr;
+ Node *pNode = nullptr;
// Type consistency checks
pNode = pMap;
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h b/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h
new file mode 100644
index 0000000000..8ca61ac6cc
--- /dev/null
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/depthguard.h
@@ -0,0 +1,77 @@
+#ifndef DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
+#define DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
+
+#if defined(_MSC_VER) || \
+ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
+ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
+#pragma once
+#endif
+
+#include "exceptions.h"
+
+namespace YAML {
+
+/**
+ * @brief The DeepRecursion class
+ * An exception class which is thrown by DepthGuard. Ideally it should be
+ * a member of DepthGuard. However, DepthGuard is a templated class which means
+ * that any catch points would then need to know the template parameters. It is
+ * simpler for clients to not have to know at the catch point what was the
+ * maximum depth.
+ */
+class DeepRecursion : public ParserException {
+public:
+ virtual ~DeepRecursion() = default;
+
+ DeepRecursion(int depth, const Mark& mark_, const std::string& msg_);
+
+ // Returns the recursion depth when the exception was thrown
+ int depth() const {
+ return m_depth;
+ }
+
+private:
+ int m_depth = 0;
+};
+
+/**
+ * @brief The DepthGuard class
+ * DepthGuard takes a reference to an integer. It increments the integer upon
+ * construction of DepthGuard and decrements the integer upon destruction.
+ *
+ * If the integer would be incremented past max_depth, then an exception is
+ * thrown. This is ideally geared toward guarding against deep recursion.
+ *
+ * @param max_depth
+ * compile-time configurable maximum depth.
+ */
+template
+class DepthGuard final {
+public:
+ DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) {
+ ++m_depth;
+ if ( max_depth <= m_depth ) {
+ throw DeepRecursion{m_depth, mark_, msg_};
+ }
+ }
+
+ DepthGuard(const DepthGuard & copy_ctor) = delete;
+ DepthGuard(DepthGuard && move_ctor) = delete;
+ DepthGuard & operator=(const DepthGuard & copy_assign) = delete;
+ DepthGuard & operator=(DepthGuard && move_assign) = delete;
+
+ ~DepthGuard() {
+ --m_depth;
+ }
+
+ int current_depth() const {
+ return m_depth;
+ }
+
+private:
+ int & m_depth;
+};
+
+} // namespace YAML
+
+#endif // DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/dll.h b/3rdparty/yaml-cpp/include/yaml-cpp/dll.h
index a32c06b2e3..eabdda1d95 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/dll.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/dll.h
@@ -1,33 +1,61 @@
#ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-#if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
-#pragma once
+// Definition YAML_CPP_STATIC_DEFINE using to building YAML-CPP as static
+// library (definition created by CMake or defined manually)
+
+// Definition yaml_cpp_EXPORTS using to building YAML-CPP as dll/so library
+// (definition created by CMake or defined manually)
+
+#ifdef YAML_CPP_STATIC_DEFINE
+# define YAML_CPP_API
+# define YAML_CPP_NO_EXPORT
+#else
+# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
+# ifndef YAML_CPP_API
+# ifdef yaml_cpp_EXPORTS
+ /* We are building this library */
+# pragma message( "Defining YAML_CPP_API for DLL export" )
+# define YAML_CPP_API __declspec(dllexport)
+# else
+ /* We are using this library */
+# pragma message( "Defining YAML_CPP_API for DLL import" )
+# define YAML_CPP_API __declspec(dllimport)
+# endif
+# endif
+# ifndef YAML_CPP_NO_EXPORT
+# define YAML_CPP_NO_EXPORT
+# endif
+# else /* No _MSC_VER */
+# ifndef YAML_CPP_API
+# ifdef yaml_cpp_EXPORTS
+ /* We are building this library */
+# define YAML_CPP_API __attribute__((visibility("default")))
+# else
+ /* We are using this library */
+# define YAML_CPP_API __attribute__((visibility("default")))
+# endif
+# endif
+# ifndef YAML_CPP_NO_EXPORT
+# define YAML_CPP_NO_EXPORT __attribute__((visibility("hidden")))
+# endif
+# endif /* _MSC_VER */
+#endif /* YAML_CPP_STATIC_DEFINE */
+
+#ifndef YAML_CPP_DEPRECATED
+# ifdef _MSC_VER
+# define YAML_CPP_DEPRECATED __declspec(deprecated)
+# else
+# define YAML_CPP_DEPRECATED __attribute__ ((__deprecated__))
+# endif
#endif
-// The following ifdef block is the standard way of creating macros which make
-// exporting from a DLL simpler. All files within this DLL are compiled with the
-// yaml_cpp_EXPORTS symbol defined on the command line. This symbol should not
-// be defined on any project that uses this DLL. This way any other project
-// whose source files include this file see YAML_CPP_API functions as being
-// imported from a DLL, whereas this DLL sees symbols defined with this macro as
-// being exported.
-#undef YAML_CPP_API
+#ifndef YAML_CPP_DEPRECATED_EXPORT
+# define YAML_CPP_DEPRECATED_EXPORT YAML_CPP_API YAML_CPP_DEPRECATED
+#endif
-#ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined
- // manually)
-#ifdef yaml_cpp_EXPORTS // Building YAML-CPP DLL (definition created by CMake
- // or defined manually)
-// #pragma message( "Defining YAML_CPP_API for DLL export" )
-#define YAML_CPP_API __declspec(dllexport)
-#else // yaml_cpp_EXPORTS
-// #pragma message( "Defining YAML_CPP_API for DLL import" )
-#define YAML_CPP_API __declspec(dllimport)
-#endif // yaml_cpp_EXPORTS
-#else // YAML_CPP_DLL
-#define YAML_CPP_API
-#endif // YAML_CPP_DLL
+#ifndef YAML_CPP_DEPRECATED_NO_EXPORT
+# define YAML_CPP_DEPRECATED_NO_EXPORT YAML_CPP_NO_EXPORT YAML_CPP_DEPRECATED
+#endif
-#endif // DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+#endif /* DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 */
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h b/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h
index f14b051ab0..1f389c5a13 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/emitfromevents.h
@@ -24,21 +24,21 @@ class EmitFromEvents : public EventHandler {
public:
EmitFromEvents(Emitter& emitter);
- virtual void OnDocumentStart(const Mark& mark);
- virtual void OnDocumentEnd();
+ void OnDocumentStart(const Mark& mark) override;
+ void OnDocumentEnd() override;
- virtual void OnNull(const Mark& mark, anchor_t anchor);
- virtual void OnAlias(const Mark& mark, anchor_t anchor);
- virtual void OnScalar(const Mark& mark, const std::string& tag,
- anchor_t anchor, const std::string& value);
+ void OnNull(const Mark& mark, anchor_t anchor) override;
+ void OnAlias(const Mark& mark, anchor_t anchor) override;
+ void OnScalar(const Mark& mark, const std::string& tag,
+ anchor_t anchor, const std::string& value) override;
- virtual void OnSequenceStart(const Mark& mark, const std::string& tag,
- anchor_t anchor, EmitterStyle::value style);
- virtual void OnSequenceEnd();
+ void OnSequenceStart(const Mark& mark, const std::string& tag,
+ anchor_t anchor, EmitterStyle::value style) override;
+ void OnSequenceEnd() override;
- virtual void OnMapStart(const Mark& mark, const std::string& tag,
- anchor_t anchor, EmitterStyle::value style);
- virtual void OnMapEnd();
+ void OnMapStart(const Mark& mark, const std::string& tag,
+ anchor_t anchor, EmitterStyle::value style) override;
+ void OnMapEnd() override;
private:
void BeginNode();
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h b/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h
index 0c6958d5fa..210b1ec974 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/emitter.h
@@ -7,16 +7,18 @@
#pragma once
#endif
+#include
#include
+#include
#include
#include
#include
+#include
#include "yaml-cpp/binary.h"
#include "yaml-cpp/dll.h"
#include "yaml-cpp/emitterdef.h"
#include "yaml-cpp/emittermanip.h"
-#include "yaml-cpp/noncopyable.h"
#include "yaml-cpp/null.h"
#include "yaml-cpp/ostream_wrapper.h"
@@ -28,10 +30,12 @@ struct _Null;
namespace YAML {
class EmitterState;
-class YAML_CPP_API Emitter : private noncopyable {
+class YAML_CPP_API Emitter {
public:
Emitter();
explicit Emitter(std::ostream& stream);
+ Emitter(const Emitter&) = delete;
+ Emitter& operator=(const Emitter&) = delete;
~Emitter();
// output
@@ -55,6 +59,7 @@ class YAML_CPP_API Emitter : private noncopyable {
bool SetPostCommentIndent(std::size_t n);
bool SetFloatPrecision(std::size_t n);
bool SetDoublePrecision(std::size_t n);
+ void RestoreGlobalModifiedSettings();
// local setters
Emitter& SetLocalValue(EMITTER_MANIP value);
@@ -120,6 +125,7 @@ class YAML_CPP_API Emitter : private noncopyable {
void SpaceOrIndentTo(bool requireSpace, std::size_t indent);
const char* ComputeFullBoolName(bool b) const;
+ const char* ComputeNullName() const;
bool CanEmitNewline() const;
private:
@@ -153,7 +159,27 @@ inline Emitter& Emitter::WriteStreamable(T value) {
std::stringstream stream;
SetStreamablePrecision(stream);
- stream << value;
+
+ bool special = false;
+ if (std::is_floating_point::value) {
+ if ((std::numeric_limits::has_quiet_NaN ||
+ std::numeric_limits::has_signaling_NaN) &&
+ std::isnan(value)) {
+ special = true;
+ stream << ".nan";
+ } else if (std::numeric_limits::has_infinity && std::isinf(value)) {
+ special = true;
+ if (std::signbit(value)) {
+ stream << "-.inf";
+ } else {
+ stream << ".inf";
+ }
+ }
+ }
+
+ if (!special) {
+ stream << value;
+ }
m_stream << stream.str();
StartedScalar();
@@ -250,6 +276,6 @@ inline Emitter& operator<<(Emitter& emitter, _Indent indent) {
inline Emitter& operator<<(Emitter& emitter, _Precision precision) {
return emitter.SetLocalPrecision(precision);
}
-}
+} // namespace YAML
#endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h b/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h
index 7f56d684c2..976d14950f 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/emittermanip.h
@@ -27,6 +27,12 @@ enum EMITTER_MANIP {
DoubleQuoted,
Literal,
+ // null manipulators
+ LowerNull,
+ UpperNull,
+ CamelNull,
+ TildeNull,
+
// bool manipulators
YesNoBool, // yes, no
TrueFalseBool, // true, false
@@ -37,10 +43,6 @@ enum EMITTER_MANIP {
LongBool, // yes, On
ShortBool, // y, t
- // null manipulators
- NullAsTilde, // ~
- NullAsNull, // null
-
// int manipulators
Dec,
Hex,
@@ -79,14 +81,14 @@ struct _Alias {
std::string content;
};
-inline _Alias Alias(const std::string content) { return _Alias(content); }
+inline _Alias Alias(const std::string& content) { return _Alias(content); }
struct _Anchor {
_Anchor(const std::string& content_) : content(content_) {}
std::string content;
};
-inline _Anchor Anchor(const std::string content) { return _Anchor(content); }
+inline _Anchor Anchor(const std::string& content) { return _Anchor(content); }
struct _Tag {
struct Type {
@@ -101,11 +103,11 @@ struct _Tag {
Type::value type;
};
-inline _Tag VerbatimTag(const std::string content) {
+inline _Tag VerbatimTag(const std::string& content) {
return _Tag("", content, _Tag::Type::Verbatim);
}
-inline _Tag LocalTag(const std::string content) {
+inline _Tag LocalTag(const std::string& content) {
return _Tag("", content, _Tag::Type::PrimaryHandle);
}
@@ -113,7 +115,7 @@ inline _Tag LocalTag(const std::string& prefix, const std::string content) {
return _Tag(prefix, content, _Tag::Type::NamedHandle);
}
-inline _Tag SecondaryTag(const std::string content) {
+inline _Tag SecondaryTag(const std::string& content) {
return _Tag("", content, _Tag::Type::NamedHandle);
}
@@ -122,7 +124,7 @@ struct _Comment {
std::string content;
};
-inline _Comment Comment(const std::string content) { return _Comment(content); }
+inline _Comment Comment(const std::string& content) { return _Comment(content); }
struct _Precision {
_Precision(int floatPrecision_, int doublePrecision_)
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h b/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h
index efe381c621..7242fe1f5b 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/eventhandler.h
@@ -17,7 +17,7 @@ struct Mark;
class EventHandler {
public:
- virtual ~EventHandler() {}
+ virtual ~EventHandler() = default;
virtual void OnDocumentStart(const Mark& mark) = 0;
virtual void OnDocumentEnd() = 0;
@@ -34,7 +34,12 @@ class EventHandler {
virtual void OnMapStart(const Mark& mark, const std::string& tag,
anchor_t anchor, EmitterStyle::value style) = 0;
virtual void OnMapEnd() = 0;
+
+ virtual void OnAnchor(const Mark& /*mark*/,
+ const std::string& /*anchor_name*/) {
+ // empty default implementation for compatibility
+ }
};
-}
+} // namespace YAML
#endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h b/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h
index 7bfd0a135e..f6b2602ae1 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/exceptions.h
@@ -7,19 +7,8 @@
#pragma once
#endif
-#ifndef NOEXCEPT
-#ifdef _MSC_VER
-#ifdef _NOEXCEPT
-#define NOEXCEPT _NOEXCEPT
-#else
-#define NOEXCEPT
-#endif // ifdef _NOEXCEPT
-#else
-#define NOEXCEPT noexcept
-#endif // ifdef _MSC_VER
-#endif // ifdef NOEXCEPT
-
#include "yaml-cpp/mark.h"
+#include "yaml-cpp/noexcept.h"
#include "yaml-cpp/traits.h"
#include
#include
@@ -76,7 +65,7 @@ const char* const ZERO_INDENT_IN_BLOCK =
const char* const CHAR_IN_BLOCK = "unexpected character in block scalar";
const char* const AMBIGUOUS_ANCHOR =
"cannot assign the same alias to multiple nodes";
-const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined";
+const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined: ";
const char* const INVALID_NODE =
"invalid node; this may result from using a map iterator as a sequence "
@@ -111,6 +100,12 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) {
return stream.str();
}
+inline const std::string KEY_NOT_FOUND_WITH_KEY(const char* key) {
+ std::stringstream stream;
+ stream << KEY_NOT_FOUND << ": " << key;
+ return stream.str();
+}
+
template
inline const std::string KEY_NOT_FOUND_WITH_KEY(
const T& key, typename enable_if>::type* = 0) {
@@ -118,13 +113,48 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(
stream << KEY_NOT_FOUND << ": " << key;
return stream.str();
}
+
+template
+inline const std::string BAD_SUBSCRIPT_WITH_KEY(
+ const T&, typename disable_if>::type* = nullptr) {
+ return BAD_SUBSCRIPT;
}
+inline const std::string BAD_SUBSCRIPT_WITH_KEY(const std::string& key) {
+ std::stringstream stream;
+ stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")";
+ return stream.str();
+}
+
+inline const std::string BAD_SUBSCRIPT_WITH_KEY(const char* key) {
+ std::stringstream stream;
+ stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")";
+ return stream.str();
+}
+
+template
+inline const std::string BAD_SUBSCRIPT_WITH_KEY(
+ const T& key, typename enable_if>::type* = nullptr) {
+ std::stringstream stream;
+ stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")";
+ return stream.str();
+}
+
+inline const std::string INVALID_NODE_WITH_KEY(const std::string& key) {
+ std::stringstream stream;
+ if (key.empty()) {
+ return INVALID_NODE;
+ }
+ stream << "invalid node; first invalid key: \"" << key << "\"";
+ return stream.str();
+}
+} // namespace ErrorMsg
+
class YAML_CPP_API Exception : public std::runtime_error {
public:
Exception(const Mark& mark_, const std::string& msg_)
: std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
- virtual ~Exception() NOEXCEPT;
+ ~Exception() YAML_CPP_NOEXCEPT override;
Exception(const Exception&) = default;
@@ -135,7 +165,7 @@ class YAML_CPP_API Exception : public std::runtime_error {
static const std::string build_what(const Mark& mark,
const std::string& msg) {
if (mark.is_null()) {
- return msg.c_str();
+ return msg;
}
std::stringstream output;
@@ -150,7 +180,7 @@ class YAML_CPP_API ParserException : public Exception {
ParserException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
ParserException(const ParserException&) = default;
- virtual ~ParserException() NOEXCEPT;
+ ~ParserException() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API RepresentationException : public Exception {
@@ -158,7 +188,7 @@ class YAML_CPP_API RepresentationException : public Exception {
RepresentationException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
RepresentationException(const RepresentationException&) = default;
- virtual ~RepresentationException() NOEXCEPT;
+ ~RepresentationException() YAML_CPP_NOEXCEPT override;
};
// representation exceptions
@@ -167,7 +197,7 @@ class YAML_CPP_API InvalidScalar : public RepresentationException {
InvalidScalar(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {}
InvalidScalar(const InvalidScalar&) = default;
- virtual ~InvalidScalar() NOEXCEPT;
+ ~InvalidScalar() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API KeyNotFound : public RepresentationException {
@@ -177,7 +207,7 @@ class YAML_CPP_API KeyNotFound : public RepresentationException {
: RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) {
}
KeyNotFound(const KeyNotFound&) = default;
- virtual ~KeyNotFound() NOEXCEPT;
+ ~KeyNotFound() YAML_CPP_NOEXCEPT override;
};
template
@@ -185,7 +215,7 @@ class YAML_CPP_API TypedKeyNotFound : public KeyNotFound {
public:
TypedKeyNotFound(const Mark& mark_, const T& key_)
: KeyNotFound(mark_, key_), key(key_) {}
- virtual ~TypedKeyNotFound() NOEXCEPT {}
+ ~TypedKeyNotFound() YAML_CPP_NOEXCEPT override = default;
T key;
};
@@ -198,10 +228,11 @@ inline TypedKeyNotFound MakeTypedKeyNotFound(const Mark& mark,
class YAML_CPP_API InvalidNode : public RepresentationException {
public:
- InvalidNode()
- : RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {}
+ InvalidNode(const std::string& key)
+ : RepresentationException(Mark::null_mark(),
+ ErrorMsg::INVALID_NODE_WITH_KEY(key)) {}
InvalidNode(const InvalidNode&) = default;
- virtual ~InvalidNode() NOEXCEPT;
+ ~InvalidNode() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API BadConversion : public RepresentationException {
@@ -209,7 +240,7 @@ class YAML_CPP_API BadConversion : public RepresentationException {
explicit BadConversion(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {}
BadConversion(const BadConversion&) = default;
- virtual ~BadConversion() NOEXCEPT;
+ ~BadConversion() YAML_CPP_NOEXCEPT override;
};
template
@@ -223,15 +254,16 @@ class YAML_CPP_API BadDereference : public RepresentationException {
BadDereference()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {}
BadDereference(const BadDereference&) = default;
- virtual ~BadDereference() NOEXCEPT;
+ ~BadDereference() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API BadSubscript : public RepresentationException {
public:
- BadSubscript()
- : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {}
+ template
+ BadSubscript(const Mark& mark_, const Key& key)
+ : RepresentationException(mark_, ErrorMsg::BAD_SUBSCRIPT_WITH_KEY(key)) {}
BadSubscript(const BadSubscript&) = default;
- virtual ~BadSubscript() NOEXCEPT;
+ ~BadSubscript() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API BadPushback : public RepresentationException {
@@ -239,7 +271,7 @@ class YAML_CPP_API BadPushback : public RepresentationException {
BadPushback()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {}
BadPushback(const BadPushback&) = default;
- virtual ~BadPushback() NOEXCEPT;
+ ~BadPushback() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API BadInsert : public RepresentationException {
@@ -247,7 +279,7 @@ class YAML_CPP_API BadInsert : public RepresentationException {
BadInsert()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {}
BadInsert(const BadInsert&) = default;
- virtual ~BadInsert() NOEXCEPT;
+ ~BadInsert() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API EmitterException : public Exception {
@@ -255,15 +287,17 @@ class YAML_CPP_API EmitterException : public Exception {
EmitterException(const std::string& msg_)
: Exception(Mark::null_mark(), msg_) {}
EmitterException(const EmitterException&) = default;
- virtual ~EmitterException() NOEXCEPT;
+ ~EmitterException() YAML_CPP_NOEXCEPT override;
};
class YAML_CPP_API BadFile : public Exception {
public:
- BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {}
+ explicit BadFile(const std::string& filename)
+ : Exception(Mark::null_mark(),
+ std::string(ErrorMsg::BAD_FILE) + ": " + filename) {}
BadFile(const BadFile&) = default;
- virtual ~BadFile() NOEXCEPT;
+ ~BadFile() YAML_CPP_NOEXCEPT override;
};
-}
+} // namespace YAML
#endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h b/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h
index 45a878ab0c..292c5d3c03 100644
--- a/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h
+++ b/3rdparty/yaml-cpp/include/yaml-cpp/node/convert.h
@@ -8,10 +8,14 @@
#endif
#include
+#include
#include
#include
#include