Auto update
This commit is contained in:
parent
642312f996
commit
6672fa19bd
4907 changed files with 206456 additions and 171700 deletions
|
|
@ -15,11 +15,9 @@
|
|||
# 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
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class Emitter;
|
|||
class EmitFromEvents : public EventHandler {
|
||||
public:
|
||||
EmitFromEvents(Emitter& emitter);
|
||||
~EmitFromEvents() override = default;
|
||||
|
||||
void OnDocumentStart(const Mark& mark) override;
|
||||
void OnDocumentEnd() override;
|
||||
|
|
|
|||
|
|
@ -9,18 +9,24 @@
|
|||
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
#include "yaml-cpp/binary.h"
|
||||
#include "yaml-cpp/dll.h"
|
||||
#include "yaml-cpp/emitterdef.h"
|
||||
#include "yaml-cpp/emittermanip.h"
|
||||
#include "yaml-cpp/null.h"
|
||||
#include "yaml-cpp/ostream_wrapper.h"
|
||||
#include "yaml-cpp/fptostring.h"
|
||||
|
||||
namespace YAML {
|
||||
class Binary;
|
||||
|
|
@ -67,6 +73,7 @@ class YAML_CPP_API Emitter {
|
|||
Emitter& SetLocalPrecision(const _Precision& precision);
|
||||
|
||||
// overloads of write
|
||||
Emitter& Write(const char* str, std::size_t size);
|
||||
Emitter& Write(const std::string& str);
|
||||
Emitter& Write(bool b);
|
||||
Emitter& Write(char ch);
|
||||
|
|
@ -141,6 +148,7 @@ inline Emitter& Emitter::WriteIntegralType(T value) {
|
|||
PrepareNode(EmitterNodeType::Scalar);
|
||||
|
||||
std::stringstream stream;
|
||||
stream.imbue(std::locale::classic());
|
||||
PrepareIntegralStream(stream);
|
||||
stream << value;
|
||||
m_stream << stream.str();
|
||||
|
|
@ -158,6 +166,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
|
|||
PrepareNode(EmitterNodeType::Scalar);
|
||||
|
||||
std::stringstream stream;
|
||||
stream.imbue(std::locale::classic());
|
||||
SetStreamablePrecision<T>(stream);
|
||||
|
||||
bool special = false;
|
||||
|
|
@ -178,7 +187,7 @@ inline Emitter& Emitter::WriteStreamable(T value) {
|
|||
}
|
||||
|
||||
if (!special) {
|
||||
stream << value;
|
||||
stream << FpToString(value, stream.precision());
|
||||
}
|
||||
m_stream << stream.str();
|
||||
|
||||
|
|
@ -198,8 +207,13 @@ inline void Emitter::SetStreamablePrecision<double>(std::stringstream& stream) {
|
|||
}
|
||||
|
||||
// overloads of insertion
|
||||
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||
inline Emitter& operator<<(Emitter& emitter, const std::string_view& v) {
|
||||
return emitter.Write(v.data(), v.size());
|
||||
}
|
||||
#endif
|
||||
inline Emitter& operator<<(Emitter& emitter, const std::string& v) {
|
||||
return emitter.Write(v);
|
||||
return emitter.Write(v.data(), v.size());
|
||||
}
|
||||
inline Emitter& operator<<(Emitter& emitter, bool v) {
|
||||
return emitter.Write(v);
|
||||
|
|
@ -230,7 +244,7 @@ inline Emitter& operator<<(Emitter& emitter, const Binary& b) {
|
|||
}
|
||||
|
||||
inline Emitter& operator<<(Emitter& emitter, const char* v) {
|
||||
return emitter.Write(std::string(v));
|
||||
return emitter.Write(v, std::strlen(v));
|
||||
}
|
||||
|
||||
inline Emitter& operator<<(Emitter& emitter, int v) {
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@
|
|||
#endif
|
||||
|
||||
namespace YAML {
|
||||
struct EmitterStyle {
|
||||
enum value { Default, Block, Flow };
|
||||
};
|
||||
namespace EmitterStyle {
|
||||
enum value { Default, Block, Flow };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ const char* const UNKNOWN_TOKEN = "unknown token";
|
|||
const char* const DOC_IN_SCALAR = "illegal document indicator in scalar";
|
||||
const char* const EOF_IN_SCALAR = "illegal EOF in scalar";
|
||||
const char* const CHAR_IN_SCALAR = "illegal character in scalar";
|
||||
const char* const UNEXPECTED_SCALAR = "unexpected scalar";
|
||||
const char* const UNEXPECTED_FLOW = "plain value cannot start with flow indicator character";
|
||||
const char* const TAB_IN_INDENTATION =
|
||||
"illegal tab when looking for indentation";
|
||||
const char* const FLOW_END = "illegal flow end";
|
||||
|
|
|
|||
15
yaml-cpp/x86_64/include/yaml-cpp/fptostring.h
Normal file
15
yaml-cpp/x86_64/include/yaml-cpp/fptostring.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#ifndef YAML_H_FPTOSTRING
|
||||
#define YAML_H_FPTOSTRING
|
||||
|
||||
#include "yaml-cpp/dll.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace YAML {
|
||||
// "precision = 0" refers to shortest known unique representation of the value
|
||||
YAML_CPP_API std::string FpToString(float v, size_t precision = 0);
|
||||
YAML_CPP_API std::string FpToString(double v, size_t precision = 0);
|
||||
YAML_CPP_API std::string FpToString(long double v, size_t precision = 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#include <valarray>
|
||||
#include <vector>
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
#include "yaml-cpp/node/node.h"
|
||||
#include "yaml-cpp/node/type.h"
|
||||
#include "yaml-cpp/null.h"
|
||||
#include "yaml-cpp/fptostring.h"
|
||||
|
||||
|
||||
namespace YAML {
|
||||
|
|
@ -93,7 +94,7 @@ struct convert<char[N]> {
|
|||
static Node encode(const char* rhs) { return Node(rhs); }
|
||||
};
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
||||
template <>
|
||||
struct convert<std::string_view> {
|
||||
static Node encode(std::string_view rhs) { return Node(std::string(rhs)); }
|
||||
|
|
@ -129,7 +130,7 @@ inner_encode(const T& rhs, std::stringstream& stream){
|
|||
stream << ".inf";
|
||||
}
|
||||
} else {
|
||||
stream << rhs;
|
||||
stream << FpToString(rhs, stream.precision());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,6 +172,7 @@ ConvertStreamTo(std::stringstream& stream, T& rhs) {
|
|||
\
|
||||
static Node encode(const type& rhs) { \
|
||||
std::stringstream stream; \
|
||||
stream.imbue(std::locale::classic()); \
|
||||
stream.precision(std::numeric_limits<type>::max_digits10); \
|
||||
conversion::inner_encode(rhs, stream); \
|
||||
return Node(stream.str()); \
|
||||
|
|
@ -182,6 +184,7 @@ ConvertStreamTo(std::stringstream& stream, T& rhs) {
|
|||
} \
|
||||
const std::string& input = node.Scalar(); \
|
||||
std::stringstream stream(input); \
|
||||
stream.imbue(std::locale::classic()); \
|
||||
stream.unsetf(std::ios::dec); \
|
||||
if ((stream.peek() == '-') && std::is_unsigned<type>::value) { \
|
||||
return false; \
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class iterator_base {
|
|||
using value_type = V;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = V*;
|
||||
using reference = V;
|
||||
using reference = V&;
|
||||
|
||||
public:
|
||||
iterator_base() : m_iterator(), m_pMemory() {}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class YAML_CPP_API memory {
|
|||
memory() : m_nodes{} {}
|
||||
node& create_node();
|
||||
void merge(const memory& rhs);
|
||||
size_t size() const;
|
||||
|
||||
private:
|
||||
using Nodes = std::set<shared_node>;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class node_iterator_base {
|
|||
using value_type = node_iterator_value<V>;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using pointer = node_iterator_value<V>*;
|
||||
using reference = node_iterator_value<V>;
|
||||
using reference = node_iterator_value<V>&;
|
||||
using SeqIter = typename node_iterator_type<V>::seq;
|
||||
using MapIter = typename node_iterator_type<V>::map;
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ struct as_if {
|
|||
if (!node.m_pNode)
|
||||
return fallback;
|
||||
|
||||
T t;
|
||||
T t = fallback;
|
||||
if (convert<T>::decode(node, t))
|
||||
return t;
|
||||
return fallback;
|
||||
|
|
@ -124,8 +124,8 @@ struct as_if<T, void> {
|
|||
const Node& node;
|
||||
|
||||
T operator()() const {
|
||||
if (!node.m_pNode)
|
||||
throw TypedBadConversion<T>(node.Mark());
|
||||
if (!node.m_pNode) // no fallback
|
||||
throw InvalidNode(node.m_invalidKey);
|
||||
|
||||
T t;
|
||||
if (convert<T>::decode(node, t))
|
||||
|
|
@ -140,6 +140,8 @@ struct as_if<std::string, void> {
|
|||
const Node& node;
|
||||
|
||||
std::string operator()() const {
|
||||
if (node.Type() == NodeType::Undefined) // no fallback
|
||||
throw InvalidNode(node.m_invalidKey);
|
||||
if (node.Type() == NodeType::Null)
|
||||
return "null";
|
||||
if (node.Type() != NodeType::Scalar)
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@
|
|||
#endif
|
||||
|
||||
namespace YAML {
|
||||
struct NodeType {
|
||||
enum value { Undefined, Null, Scalar, Sequence, Map };
|
||||
};
|
||||
namespace NodeType {
|
||||
enum value { Undefined, Null, Scalar, Sequence, Map };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // VALUE_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#endif
|
||||
|
||||
#include "yaml-cpp/dll.h"
|
||||
#include <string>
|
||||
#include <cstddef>
|
||||
|
||||
namespace YAML {
|
||||
class Node;
|
||||
|
|
@ -18,7 +18,7 @@ inline bool operator==(const _Null&, const _Null&) { return true; }
|
|||
inline bool operator!=(const _Null&, const _Null&) { return false; }
|
||||
|
||||
YAML_CPP_API bool IsNull(const Node& node); // old API only
|
||||
YAML_CPP_API bool IsNullString(const std::string& str);
|
||||
YAML_CPP_API bool IsNullString(const char* str, std::size_t size);
|
||||
|
||||
extern YAML_CPP_API _Null Null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,7 @@ template<typename Key, bool Streamable>
|
|||
struct streamable_to_string {
|
||||
static std::string impl(const Key& key) {
|
||||
std::stringstream ss;
|
||||
ss.imbue(std::locale::classic());
|
||||
ss << key;
|
||||
return ss.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
#pragma once
|
||||
#endif
|
||||
|
||||
// IWYU pragma: begin_exports
|
||||
|
||||
#include "yaml-cpp/parser.h"
|
||||
#include "yaml-cpp/emitter.h"
|
||||
#include "yaml-cpp/emitterstyle.h"
|
||||
|
|
@ -21,4 +23,6 @@
|
|||
#include "yaml-cpp/node/parse.h"
|
||||
#include "yaml-cpp/node/emit.h"
|
||||
|
||||
// IWYU pragma: end_exports
|
||||
|
||||
#endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
set(PACKAGE_VERSION "0.8.0")
|
||||
set(PACKAGE_VERSION "0.9.0")
|
||||
|
||||
if (PACKAGE_FIND_VERSION_RANGE)
|
||||
# Package version must be in the requested version range
|
||||
|
|
|
|||
|
|
@ -35,12 +35,23 @@ set_and_check(YAML_CPP_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")
|
|||
set_and_check(YAML_CPP_LIBRARY_DIR "${PACKAGE_PREFIX_DIR}/lib")
|
||||
|
||||
# Are we building shared libraries?
|
||||
set(YAML_CPP_SHARED_LIBS_BUILT "${PACKAGE_PREFIX_DIR}/OFF")
|
||||
set(YAML_CPP_SHARED_LIBS_BUILT OFF)
|
||||
|
||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
include(${PACKAGE_PREFIX_DIR}/lib/cmake/yaml-cpp/yaml-cpp-targets.cmake)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/yaml-cpp-targets.cmake")
|
||||
|
||||
# These are IMPORTED targets created by yaml-cpp-targets.cmake
|
||||
set(YAML_CPP_LIBRARIES "yaml-cpp")
|
||||
set(YAML_CPP_LIBRARIES "yaml-cpp::yaml-cpp")
|
||||
|
||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
||||
if(NOT TARGET yaml-cpp)
|
||||
add_library(yaml-cpp INTERFACE IMPORTED)
|
||||
target_link_libraries(yaml-cpp INTERFACE yaml-cpp::yaml-cpp)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
|
||||
set_target_properties(yaml-cpp PROPERTIES
|
||||
DEPRECATION "The target yaml-cpp is deprecated and will be removed in version 0.10.0. Use the yaml-cpp::yaml-cpp target instead."
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_required_components(yaml-cpp)
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue