|
| 1 | +// _______ __ __ __ _____ __ __ __ |
| 2 | +// | __| |_/ | \_/ |/ _ \ / \/ \| | fkYAML: A C++ header-only YAML library |
| 3 | +// | __| _ < \_ _/| ___ | _ | |___ version 0.3.14 |
| 4 | +// |__| |_| \__| |_| |_| |_|___||___|______| https://github.com/fktn-k/fkYAML |
| 5 | +// |
| 6 | +// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <[email protected]> |
| 7 | +// SPDX-License-Identifier: MIT |
| 8 | + |
| 9 | +#ifndef FK_YAML_FKYAML_FWD_HPP |
| 10 | +#define FK_YAML_FKYAML_FWD_HPP |
| 11 | + |
| 12 | +#include <cstdint> |
| 13 | +#include <map> |
| 14 | +#include <string> |
| 15 | +#include <vector> |
| 16 | + |
| 17 | +// #include <fkYAML/detail/macros/version_macros.hpp> |
| 18 | +// _______ __ __ __ _____ __ __ __ |
| 19 | +// | __| |_/ | \_/ |/ _ \ / \/ \| | fkYAML: A C++ header-only YAML library |
| 20 | +// | __| _ < \_ _/| ___ | _ | |___ version 0.3.14 |
| 21 | +// |__| |_| \__| |_| |_| |_|___||___|______| https://github.com/fktn-k/fkYAML |
| 22 | +// |
| 23 | +// SPDX-FileCopyrightText: 2023-2024 Kensuke Fukutani <[email protected]> |
| 24 | +// SPDX-License-Identifier: MIT |
| 25 | + |
| 26 | +// Check version definitions if already defined. |
| 27 | +#if defined(FK_YAML_MAJOR_VERSION) && defined(FK_YAML_MINOR_VERSION) && defined(FK_YAML_PATCH_VERSION) |
| 28 | +#if FK_YAML_MAJOR_VERSION != 0 || FK_YAML_MINOR_VERSION != 3 || FK_YAML_PATCH_VERSION != 14 |
| 29 | +#warning Already included a different version of the fkYAML library! |
| 30 | +#else |
| 31 | +// define macros to skip defining macros down below. |
| 32 | +#define FK_YAML_VERCHECK_SUCCEEDED |
| 33 | +#endif |
| 34 | +#endif |
| 35 | + |
| 36 | +#ifndef FK_YAML_VERCHECK_SUCCEEDED |
| 37 | + |
| 38 | +#define FK_YAML_MAJOR_VERSION 0 |
| 39 | +#define FK_YAML_MINOR_VERSION 3 |
| 40 | +#define FK_YAML_PATCH_VERSION 14 |
| 41 | + |
| 42 | +#define FK_YAML_NAMESPACE_VERSION_CONCAT_IMPL(major, minor, patch) v##major##_##minor##_##patch |
| 43 | + |
| 44 | +#define FK_YAML_NAMESPACE_VERSION_CONCAT(major, minor, patch) FK_YAML_NAMESPACE_VERSION_CONCAT_IMPL(major, minor, patch) |
| 45 | + |
| 46 | +#define FK_YAML_NAMESPACE_VERSION \ |
| 47 | + FK_YAML_NAMESPACE_VERSION_CONCAT(FK_YAML_MAJOR_VERSION, FK_YAML_MINOR_VERSION, FK_YAML_PATCH_VERSION) |
| 48 | + |
| 49 | +#define FK_YAML_NAMESPACE_BEGIN \ |
| 50 | + namespace fkyaml { \ |
| 51 | + inline namespace FK_YAML_NAMESPACE_VERSION { |
| 52 | + |
| 53 | +#define FK_YAML_NAMESPACE_END \ |
| 54 | + } /* inline namespace FK_YAML_NAMESPACE_VERSION */ \ |
| 55 | + } // namespace fkyaml |
| 56 | + |
| 57 | +#define FK_YAML_DETAIL_NAMESPACE_BEGIN \ |
| 58 | + FK_YAML_NAMESPACE_BEGIN \ |
| 59 | + namespace detail { |
| 60 | + |
| 61 | +#define FK_YAML_DETAIL_NAMESPACE_END \ |
| 62 | + } /* namespace detail */ \ |
| 63 | + FK_YAML_NAMESPACE_END |
| 64 | + |
| 65 | +#endif // !defined(FK_YAML_VERCHECK_SUCCEEDED) |
| 66 | + |
| 67 | + |
| 68 | +FK_YAML_NAMESPACE_BEGIN |
| 69 | + |
| 70 | +/// @brief An ADL friendly converter between basic_node objects and native data objects. |
| 71 | +/// @tparam ValueType A target data type. |
| 72 | +/// @sa https://fktn-k.github.io/fkYAML/api/node_value_converter/ |
| 73 | +template <typename ValueType, typename = void> |
| 74 | +class node_value_converter; |
| 75 | + |
| 76 | +/// @brief A class to store value of YAML nodes. |
| 77 | +/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/ |
| 78 | +template < |
| 79 | + template <typename, typename...> class SequenceType = std::vector, |
| 80 | + template <typename, typename, typename...> class MappingType = std::map, typename BooleanType = bool, |
| 81 | + typename IntegerType = std::int64_t, typename FloatNumberType = double, typename StringType = std::string, |
| 82 | + template <typename, typename = void> class ConverterType = node_value_converter> |
| 83 | +class basic_node; |
| 84 | + |
| 85 | +/// @brief default YAML node value container. |
| 86 | +/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/node/ |
| 87 | +using node = basic_node<>; |
| 88 | + |
| 89 | +/// @brief A minimal map-like container which preserves insertion order. |
| 90 | +/// @tparam Key A type for keys. |
| 91 | +/// @tparam Value A type for values. |
| 92 | +/// @tparam IgnoredCompare A placeholder for key comparison. This will be ignored. |
| 93 | +/// @tparam Allocator A class for allocators. |
| 94 | +/// @sa https://fktn-k.github.io/fkYAML/api/ordered_map/ |
| 95 | +template <typename Key, typename Value, typename IgnoredCompare, typename Allocator> |
| 96 | +class ordered_map; |
| 97 | + |
| 98 | +FK_YAML_NAMESPACE_END |
| 99 | + |
| 100 | +#endif /* FK_YAML_FKYAML_FWD_HPP */ |
0 commit comments