diff options
| author | Stefan Boberg <[email protected]> | 2026-02-24 15:02:58 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-02-24 15:02:58 +0100 |
| commit | 2af00d3ff720969fb3b4d471778efcf8c7b3fad4 (patch) | |
| tree | 9193eb3ff8cc9f3fb5e3342d94bde8c193a977ce /thirdparty/ryml/src/c4/yml/std | |
| parent | added zencore/filesystem.h include (diff) | |
| parent | Various bug fixes (#778) (diff) | |
| download | zen-sb/spdlog-out.tar.xz zen-sb/spdlog-out.zip | |
Merge branch 'main' into sb/spdlog-outsb/spdlog-out
Diffstat (limited to 'thirdparty/ryml/src/c4/yml/std')
| -rw-r--r-- | thirdparty/ryml/src/c4/yml/std/map.hpp | 45 | ||||
| -rw-r--r-- | thirdparty/ryml/src/c4/yml/std/std.hpp | 8 | ||||
| -rw-r--r-- | thirdparty/ryml/src/c4/yml/std/string.hpp | 9 | ||||
| -rw-r--r-- | thirdparty/ryml/src/c4/yml/std/vector.hpp | 53 |
4 files changed, 0 insertions, 115 deletions
diff --git a/thirdparty/ryml/src/c4/yml/std/map.hpp b/thirdparty/ryml/src/c4/yml/std/map.hpp deleted file mode 100644 index fc48dc5e6..000000000 --- a/thirdparty/ryml/src/c4/yml/std/map.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _C4_YML_STD_MAP_HPP_ -#define _C4_YML_STD_MAP_HPP_ - -/** @file map.hpp write/read std::map to/from a YAML tree. */ - -#include "c4/yml/node.hpp" -#include <map> - -namespace c4 { -namespace yml { - -// std::map requires child nodes in the data -// tree hierarchy (a MAP node in ryml parlance). -// So it should be serialized via write()/read(). - -template<class K, class V, class Less, class Alloc> -void write(c4::yml::NodeRef *n, std::map<K, V, Less, Alloc> const& m) -{ - *n |= c4::yml::MAP; - for(auto const& C4_RESTRICT p : m) - { - auto ch = n->append_child(); - ch << c4::yml::key(p.first); - ch << p.second; - } -} - -template<class K, class V, class Less, class Alloc> -bool read(c4::yml::ConstNodeRef const& n, std::map<K, V, Less, Alloc> * m) -{ - K k{}; - V v{}; - for(auto const& C4_RESTRICT ch : n) - { - ch >> c4::yml::key(k); - ch >> v; - m->emplace(std::make_pair(std::move(k), std::move(v))); - } - return true; -} - -} // namespace yml -} // namespace c4 - -#endif // _C4_YML_STD_MAP_HPP_ diff --git a/thirdparty/ryml/src/c4/yml/std/std.hpp b/thirdparty/ryml/src/c4/yml/std/std.hpp deleted file mode 100644 index 08e80d155..000000000 --- a/thirdparty/ryml/src/c4/yml/std/std.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _C4_YML_STD_STD_HPP_ -#define _C4_YML_STD_STD_HPP_ - -#include "c4/yml/std/string.hpp" -#include "c4/yml/std/vector.hpp" -#include "c4/yml/std/map.hpp" - -#endif // _C4_YML_STD_STD_HPP_ diff --git a/thirdparty/ryml/src/c4/yml/std/string.hpp b/thirdparty/ryml/src/c4/yml/std/string.hpp deleted file mode 100644 index e3318f91c..000000000 --- a/thirdparty/ryml/src/c4/yml/std/string.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef C4_YML_STD_STRING_HPP_ -#define C4_YML_STD_STRING_HPP_ - -/** @file string.hpp substring conversions for/from std::string */ - -// everything we need is implemented here: -#include <c4/std/string.hpp> - -#endif // C4_YML_STD_STRING_HPP_ diff --git a/thirdparty/ryml/src/c4/yml/std/vector.hpp b/thirdparty/ryml/src/c4/yml/std/vector.hpp deleted file mode 100644 index 1b6a4610a..000000000 --- a/thirdparty/ryml/src/c4/yml/std/vector.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _C4_YML_STD_VECTOR_HPP_ -#define _C4_YML_STD_VECTOR_HPP_ - -#include "c4/yml/node.hpp" -#include <c4/std/vector.hpp> -#include <vector> - -namespace c4 { -namespace yml { - -// vector is a sequence-like type, and it requires child nodes -// in the data tree hierarchy (a SEQ node in ryml parlance). -// So it should be serialized via write()/read(). - - -template<class V, class Alloc> -void write(c4::yml::NodeRef *n, std::vector<V, Alloc> const& vec) -{ - *n |= c4::yml::SEQ; - for(auto const& v : vec) - n->append_child() << v; -} - -template<class V, class Alloc> -bool read(c4::yml::ConstNodeRef const& n, std::vector<V, Alloc> *vec) -{ - vec->resize(n.num_children()); - size_t pos = 0; - for(auto const ch : n) - ch >> (*vec)[pos++]; - return true; -} - -/** specialization: std::vector<bool> uses std::vector<bool>::reference as - * the return value of its operator[]. */ -template<class Alloc> -bool read(c4::yml::ConstNodeRef const& n, std::vector<bool, Alloc> *vec) -{ - vec->resize(n.num_children()); - size_t pos = 0; - bool tmp; - for(auto const ch : n) - { - ch >> tmp; - (*vec)[pos++] = tmp; - } - return true; -} - -} // namespace yml -} // namespace c4 - -#endif // _C4_YML_STD_VECTOR_HPP_ |