NeBuild dev
Loading...
Searching...
No Matches
forward_declarations.hpp File Reference
#include "std_string.hpp"
#include "std_new.hpp"
#include <cstdint>
#include <cstddef>
#include <cstring>
#include <cfloat>
#include <climits>
#include <cmath>
#include <limits>
#include <memory>
#include <iosfwd>
#include <type_traits>
#include "header_start.hpp"
#include "header_end.hpp"

Go to the source code of this file.

Classes

struct  inserter< T >
 Helper class for suppressing move-construction in single-argument array constructors. More...
 

Namespaces

namespace  toml
 The root namespace for all toml++ functions and types.
 

Typedefs

using default_formatter = toml_formatter
 The 'default' formatter used by TOML objects when they are printed to a stream. \detail This is an alias for #toml::toml_formatter.
 

Functions

template<typename Char >
std::basic_ostream< Char > & operator<< (std::basic_ostream< Char > &lhs, node_type rhs)
 Pretty-prints the value of a node_type to a stream.
 
enum TOML_OPEN_FLAGS_ENUM TOML_MAKE_FLAGS (value_flags)
 
enum TOML_CLOSED_FLAGS_ENUM TOML_MAKE_FLAGS (format_flags)
 
template<typename T >
 inserter (T &&) -> inserter< T && >
 
template<typename T >
 inserter (T &) -> inserter< T & >
 

Variables

 TOML_DISABLE_WARNINGS
 
 TOML_ENABLE_WARNINGS
 
 TOML_NAMESPACE_START
 
enum TOML_OPEN_FLAGS_ENUM value_flags
 Metadata associated with TOML values.
 
enum TOML_OPEN_FLAGS_ENUM format_as_binary = 1
 Format integer values as binary.
 
enum TOML_OPEN_FLAGS_ENUM format_as_octal = 2
 Format integer values as octal.
 
enum TOML_OPEN_FLAGS_ENUM format_as_hexadecimal = 3
 Format integer values as hexadecimal.
 
constexpr value_flags preserve_source_value_flags
 Special #toml::value_flags constant used for array + table insert functions to specify that any value nodes being copied should not have their flags property overridden by the inserting function's flags argument.
 
enum TOML_CLOSED_FLAGS_ENUM format_flags
 Format flags for modifying how TOML data is printed to streams.
 
enum TOML_CLOSED_FLAGS_ENUM quote_dates_and_times = (1ull << 0)
 Dates and times will be emitted as quoted strings.
 
enum TOML_CLOSED_FLAGS_ENUM quote_infinities_and_nans = (1ull << 1)
 Infinities and NaNs will be emitted as quoted strings.
 
enum TOML_CLOSED_FLAGS_ENUM allow_literal_strings = (1ull << 2)
 Strings will be emitted as single-quoted literal strings where possible.
 
enum TOML_CLOSED_FLAGS_ENUM allow_multi_line_strings = (1ull << 3)
 Strings containing newlines will be emitted as triple-quoted 'multi-line' strings where possible.
 
enum TOML_CLOSED_FLAGS_ENUM allow_real_tabs_in_strings = (1ull << 4)
 Allow real tab characters in string literals (as opposed to the escaped form \t).
 
enum TOML_CLOSED_FLAGS_ENUM allow_unicode_strings = (1ull << 5)
 Allow non-ASCII characters in strings (as opposed to their escaped form, e.g. \u00DA).
 
enum TOML_CLOSED_FLAGS_ENUM allow_binary_integers = (1ull << 6)
 Allow integers with #value_flags::format_as_binary to be emitted as binary.
 
enum TOML_CLOSED_FLAGS_ENUM allow_octal_integers = (1ull << 7)
 Allow integers with #value_flags::format_as_octal to be emitted as octal.
 
enum TOML_CLOSED_FLAGS_ENUM allow_hexadecimal_integers = (1ull << 8)
 Allow integers with #value_flags::format_as_hexadecimal to be emitted as hexadecimal.
 
enum TOML_CLOSED_FLAGS_ENUM indent_sub_tables = (1ull << 9)
 Apply indentation to tables nested within other tables/arrays.
 
enum TOML_CLOSED_FLAGS_ENUM indent_array_elements = (1ull << 10)
 Apply indentation to array elements when the array is forced to wrap over multiple lines.
 
enum TOML_CLOSED_FLAGS_ENUM indentation = indent_sub_tables | indent_array_elements
 Combination mask of all indentation-enabling flags.
 
enum TOML_CLOSED_FLAGS_ENUM relaxed_float_precision = (1ull << 11)
 Emit floating-point values with relaxed (human-friendly) precision.
 
enum TOML_CLOSED_FLAGS_ENUM terse_key_value_pairs = (1ull << 12)
 Avoids the use of whitespace around key-value pairs.
 
 TOML_NAMESPACE_END
 
template<typename T >
constexpr bool is_array = std::is_same_v<impl::remove_cvref<T>, array>
 Metafunction for determining if a type is, or is a reference to, a toml::array.
 
template<typename T >
constexpr bool is_container = is_table<T> || is_array<T>
 Metafunction for determining if a type satisfies either toml::is_table or toml::is_array.
 
template<typename T >
constexpr bool is_string
 Metafunction for determining if a type is, or is a reference to, a std::string or toml::value<std::string>.
 
template<typename T >
constexpr bool is_integer
 Metafunction for determining if a type is, or is a reference to, a int64_t or toml::value<int64_t>.
 
template<typename T >
constexpr bool is_floating_point
 Metafunction for determining if a type is, or is a reference to, a double or toml::value<double>.
 
template<typename T >
constexpr bool is_number = is_integer<T> || is_floating_point<T>
 Metafunction for determining if a type satisfies either toml::is_integer or toml::is_floating_point.
 
template<typename T >
constexpr bool is_boolean
 Metafunction for determining if a type is, or is a reference to, a bool or toml::value<bool>.
 
template<typename T >
constexpr bool is_date
 Metafunction for determining if a type is, or is a reference to, a toml::date or toml::value<date>.
 
template<typename T >
constexpr bool is_time
 Metafunction for determining if a type is, or is a reference to, a toml::time or toml::value<time>.
 
template<typename T >
constexpr bool is_date_time
 Metafunction for determining if a type is, or is a reference to, a toml::date_time or toml::value<date_time>.
 
template<typename T >
constexpr bool is_chronological = is_date<T> || is_time<T> || is_date_time<T>
 Metafunction for determining if a type satisfies any of toml::is_date, toml::is_time or toml::is_date_time.
 
template<typename T >
constexpr bool is_value = is_string<T> || is_number<T> || is_boolean<T> || is_chronological<T>
 Metafunction for determining if a type is, or is a reference to, any of the toml value types. Excludes tables and arrays.
 
template<typename T >
constexpr bool is_node
 Metafunction for determining if a type is, or is a reference to, a toml::node (or one of its subclasses).
 
template<typename T >
constexpr bool is_node_view = impl::is_one_of<impl::remove_cvref<T>, node_view<node>, node_view<const node>>
 Metafunction for determining if a type is, or is a reference to, a toml::node_view.
 

Typedef Documentation

◆ default_formatter

using default_formatter = toml_formatter

The 'default' formatter used by TOML objects when they are printed to a stream. \detail This is an alias for #toml::toml_formatter.

Function Documentation

◆ inserter() [1/2]

template<typename T >
inserter ( T &&  ) -> inserter< T && >

◆ inserter() [2/2]

template<typename T >
inserter ( T &  ) -> inserter< T & >

◆ operator<<()

template<typename Char >
std::basic_ostream< Char > & operator<< ( std::basic_ostream< Char > &  lhs,
node_type  rhs 
)
inline

Pretty-prints the value of a node_type to a stream.

\detail \cpp auto arr = toml::array{ 1, 2.0, "3", false }; for (size_t i = 0; i < arr.size() i++) std::cout << "Element ["sv << i << "] is: "sv << arr[i].type() << "\n"; \ecpp

\out Element [0] is: integer Element [1] is: floating-point Element [2] is: string Element [3] is: boolean \eout

◆ TOML_MAKE_FLAGS() [1/2]

enum TOML_CLOSED_FLAGS_ENUM TOML_MAKE_FLAGS ( format_flags  )

◆ TOML_MAKE_FLAGS() [2/2]

enum TOML_OPEN_FLAGS_ENUM TOML_MAKE_FLAGS ( value_flags  )

Variable Documentation

◆ allow_binary_integers

enum TOML_CLOSED_FLAGS_ENUM allow_binary_integers = (1ull << 6)

Allow integers with #value_flags::format_as_binary to be emitted as binary.

◆ allow_hexadecimal_integers

enum TOML_CLOSED_FLAGS_ENUM allow_hexadecimal_integers = (1ull << 8)

Allow integers with #value_flags::format_as_hexadecimal to be emitted as hexadecimal.

◆ allow_literal_strings

enum TOML_CLOSED_FLAGS_ENUM allow_literal_strings = (1ull << 2)

Strings will be emitted as single-quoted literal strings where possible.

◆ allow_multi_line_strings

enum TOML_CLOSED_FLAGS_ENUM allow_multi_line_strings = (1ull << 3)

Strings containing newlines will be emitted as triple-quoted 'multi-line' strings where possible.

◆ allow_octal_integers

enum TOML_CLOSED_FLAGS_ENUM allow_octal_integers = (1ull << 7)

Allow integers with #value_flags::format_as_octal to be emitted as octal.

◆ allow_real_tabs_in_strings

enum TOML_CLOSED_FLAGS_ENUM allow_real_tabs_in_strings = (1ull << 4)

Allow real tab characters in string literals (as opposed to the escaped form \t).

◆ allow_unicode_strings

enum TOML_CLOSED_FLAGS_ENUM allow_unicode_strings = (1ull << 5)

Allow non-ASCII characters in strings (as opposed to their escaped form, e.g. \u00DA).

◆ format_as_binary

enum TOML_OPEN_FLAGS_ENUM format_as_binary = 1

Format integer values as binary.

◆ format_as_hexadecimal

enum TOML_OPEN_FLAGS_ENUM format_as_hexadecimal = 3

Format integer values as hexadecimal.

◆ format_as_octal

enum TOML_OPEN_FLAGS_ENUM format_as_octal = 2

Format integer values as octal.

◆ format_flags

enum TOML_CLOSED_FLAGS_ENUM format_flags
strong

Format flags for modifying how TOML data is printed to streams.

Note
Formatters may disregard/override any of these flags according to the requirements of their output target (e.g. #toml::json_formatter will always apply quotes to dates and times).

◆ indent_array_elements

enum TOML_CLOSED_FLAGS_ENUM indent_array_elements = (1ull << 10)

Apply indentation to array elements when the array is forced to wrap over multiple lines.

◆ indent_sub_tables

enum TOML_CLOSED_FLAGS_ENUM indent_sub_tables = (1ull << 9)

Apply indentation to tables nested within other tables/arrays.

◆ indentation

Combination mask of all indentation-enabling flags.

◆ is_array

template<typename T >
constexpr bool is_array = std::is_same_v<impl::remove_cvref<T>, array>
inlineconstexpr

Metafunction for determining if a type is, or is a reference to, a toml::array.

◆ is_boolean

template<typename T >
constexpr bool is_boolean
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<bool>>

Metafunction for determining if a type is, or is a reference to, a bool or toml::value<bool>.

◆ is_chronological

template<typename T >
constexpr bool is_chronological = is_date<T> || is_time<T> || is_date_time<T>
inlineconstexpr

Metafunction for determining if a type satisfies any of toml::is_date, toml::is_time or toml::is_date_time.

◆ is_container

template<typename T >
constexpr bool is_container = is_table<T> || is_array<T>
inlineconstexpr

Metafunction for determining if a type satisfies either toml::is_table or toml::is_array.

◆ is_date

template<typename T >
constexpr bool is_date
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<date>>

Metafunction for determining if a type is, or is a reference to, a toml::date or toml::value<date>.

◆ is_date_time

template<typename T >
constexpr bool is_date_time
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<date_time>>

Metafunction for determining if a type is, or is a reference to, a toml::date_time or toml::value<date_time>.

◆ is_floating_point

template<typename T >
constexpr bool is_floating_point
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<double>>

Metafunction for determining if a type is, or is a reference to, a double or toml::value<double>.

◆ is_integer

template<typename T >
constexpr bool is_integer
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<int64_t>>

Metafunction for determining if a type is, or is a reference to, a int64_t or toml::value<int64_t>.

◆ is_node

template<typename T >
constexpr bool is_node
inlineconstexpr
Initial value:
= std::is_same_v<toml::node, impl::remove_cvref<T>>
|| std::is_base_of_v<toml::node, impl::remove_cvref<T>>

Metafunction for determining if a type is, or is a reference to, a toml::node (or one of its subclasses).

◆ is_node_view

template<typename T >
constexpr bool is_node_view = impl::is_one_of<impl::remove_cvref<T>, node_view<node>, node_view<const node>>
inlineconstexpr

Metafunction for determining if a type is, or is a reference to, a toml::node_view.

◆ is_number

template<typename T >
constexpr bool is_number = is_integer<T> || is_floating_point<T>
inlineconstexpr

Metafunction for determining if a type satisfies either toml::is_integer or toml::is_floating_point.

◆ is_string

template<typename T >
constexpr bool is_string
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<std::string>>

Metafunction for determining if a type is, or is a reference to, a std::string or toml::value<std::string>.

◆ is_time

template<typename T >
constexpr bool is_time
inlineconstexpr
Initial value:
= std::is_same_v<
impl::remove_cvref<impl::wrap_node<impl::remove_cvref<T>>>,
value<time>>

Metafunction for determining if a type is, or is a reference to, a toml::time or toml::value<time>.

◆ is_value

template<typename T >
constexpr bool is_value = is_string<T> || is_number<T> || is_boolean<T> || is_chronological<T>
inlineconstexpr

Metafunction for determining if a type is, or is a reference to, any of the toml value types. Excludes tables and arrays.

◆ preserve_source_value_flags

constexpr value_flags preserve_source_value_flags
inlineconstexpr
Initial value:
=
POXY_IMPLEMENTATION_DETAIL(value_flags{ static_cast<std::underlying_type_t<value_flags>>(-1) })
enum TOML_OPEN_FLAGS_ENUM value_flags
Metadata associated with TOML values.
Definition forward_declarations.hpp:272
#define POXY_IMPLEMENTATION_DETAIL(...)
Definition preprocessor.hpp:633

Special #toml::value_flags constant used for array + table insert functions to specify that any value nodes being copied should not have their flags property overridden by the inserting function's flags argument.

◆ quote_dates_and_times

enum TOML_CLOSED_FLAGS_ENUM quote_dates_and_times = (1ull << 0)

Dates and times will be emitted as quoted strings.

◆ quote_infinities_and_nans

enum TOML_CLOSED_FLAGS_ENUM quote_infinities_and_nans = (1ull << 1)

Infinities and NaNs will be emitted as quoted strings.

◆ relaxed_float_precision

enum TOML_CLOSED_FLAGS_ENUM relaxed_float_precision = (1ull << 11)

Emit floating-point values with relaxed (human-friendly) precision.

Warning
Setting this flag may cause serialized documents to no longer round-trip correctly since floats might have a less precise value upon being written out than they did when being read in. Use this flag at your own risk.

◆ terse_key_value_pairs

enum TOML_CLOSED_FLAGS_ENUM terse_key_value_pairs = (1ull << 12)

Avoids the use of whitespace around key-value pairs.

◆ TOML_DISABLE_WARNINGS

TOML_DISABLE_WARNINGS

◆ TOML_ENABLE_WARNINGS

TOML_ENABLE_WARNINGS

◆ TOML_NAMESPACE_END

TOML_NAMESPACE_END

◆ TOML_NAMESPACE_START

TOML_NAMESPACE_START
Initial value:
{
inline namespace literals
{
}
enum class TOML_CLOSED_ENUM node_type : uint8_t
{
none,
string,
integer,
floating_point,
boolean,
date,
time,
}
A TOML array.
Definition array.hpp:285
A TOML table.
Definition table.hpp:220
Definition json.h:24463
#define TOML_CLOSED_ENUM
Definition preprocessor.hpp:557
A date-time.
Definition date_time.hpp:327
A local time-of-day.
Definition date_time.hpp:113

◆ value_flags

enum TOML_OPEN_FLAGS_ENUM value_flags
strong

Metadata associated with TOML values.