NeBuild dev
|
#include "preprocessor.hpp"
#include "array.hpp"
#include "date_time.hpp"
#include "parse_error.hpp"
#include "parser.hpp"
#include "source_region.hpp"
#include "std_optional.hpp"
#include "table.hpp"
#include "unicode.hpp"
#include "value.hpp"
#include <fstream>
#include <istream>
#include <sstream>
#include <iomanip>
#include "header_start.hpp"
#include "header_end.hpp"
Go to the source code of this file.
Classes | |
class | utf8_byte_stream< std::basic_string_view< Char > > |
class | utf8_byte_stream< std::istream > |
struct | utf8_codepoint |
struct | utf8_reader_interface |
class | utf8_reader< T > |
struct | utf8_reader< T >::currently_decoding_t |
struct | utf8_reader< T >::codepoints_t |
class | utf8_buffered_reader |
struct | parse_integer_traits< 2 > |
struct | parse_integer_traits< 8 > |
struct | parse_integer_traits< 10 > |
struct | parse_integer_traits< 16 > |
struct | escaped_codepoint |
struct | error_builder |
struct | parse_scope |
struct | parse_key_buffer |
struct | depth_counter_scope |
struct | parsed_string |
struct | table_vector_scope |
class | parser |
Functions | |
template<typename Char > | |
utf8_reader (std::basic_string_view< Char >, std::string_view) -> utf8_reader< std::basic_string_view< Char > > | |
template<typename Char > | |
utf8_reader (std::basic_string_view< Char >, std::string &&) -> utf8_reader< std::basic_string_view< Char > > | |
template<typename Char > | |
utf8_reader (std::basic_istream< Char > &, std::string_view) -> utf8_reader< std::basic_istream< Char > > | |
template<typename Char > | |
utf8_reader (std::basic_istream< Char > &, std::string &&) -> utf8_reader< std::basic_istream< Char > > | |
TOML_PURE_GETTER TOML_INTERNAL_LINKAGE std::string_view | to_sv (node_type val) noexcept |
TOML_PURE_GETTER TOML_INTERNAL_LINKAGE std::string_view | to_sv (const std::string &str) noexcept |
TOML_CONST_GETTER TOML_INTERNAL_LINKAGE std::string_view | to_sv (bool val) noexcept |
TOML_PURE_GETTER TOML_INTERNAL_LINKAGE std::string_view | to_sv (const utf8_codepoint &cp) noexcept |
TOML_PURE_GETTER TOML_INTERNAL_LINKAGE std::string_view | to_sv (const utf8_codepoint *cp) noexcept |
template<typename T > | |
TOML_INTERNAL_LINKAGE void | concatenate (char *&write_pos, char *const buf_end, const T &arg) noexcept |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::string_view doc, std::string_view source_path) |
Parses a TOML document from a string view. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::string_view doc, std::string &&source_path) |
Parses a TOML document from a string view. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::istream &doc, std::string_view source_path) |
Parses a TOML document from a stream. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::istream &doc, std::string &&source_path) |
Parses a TOML document from a stream. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse_file (std::string_view file_path) |
Parses a TOML document from a file. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::string_view doc, std::wstring_view source_path) |
Parses a TOML document from a string view. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse (std::istream &doc, std::wstring_view source_path) |
Parses a TOML document from a stream. | |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV | parse_file (std::wstring_view file_path) |
Parses a TOML document from a file. | |
#define advance_and_return_if_error | ( | ... | ) |
#define advance_and_return_if_error_or_eof | ( | ... | ) |
#define assert_not_eof | ( | ) | TOML_ASSERT_ASSUME(cp != nullptr) |
#define assert_not_error | ( | ) | TOML_ASSERT(!is_error()) |
#define is_eof | ( | ) | !cp |
#define is_error | ( | ) | !!err |
#define parse_error_break | ( | ) | static_assert(true) |
#define push_parse_scope | ( | scope | ) | push_parse_scope_1(scope, __LINE__) |
#define push_parse_scope_1 | ( | scope, | |
line | |||
) | push_parse_scope_2(scope, line) |
#define push_parse_scope_2 | ( | scope, | |
line | |||
) | parse_scope ps_##line(current_scope, scope) |
#define return_after_error | ( | ... | ) | return __VA_ARGS__ |
#define return_if_eof | ( | ... | ) |
#define return_if_error | ( | ... | ) |
#define return_if_error_or_eof | ( | ... | ) |
#define set_error_and_return | ( | ret, | |
... | |||
) |
#define set_error_and_return_default | ( | ... | ) | set_error_and_return({}, __VA_ARGS__) |
#define set_error_and_return_if_eof | ( | ... | ) |
#define TOML_OVERALIGNED alignas(32) |
#define TOML_PARSE_FILE_ERROR | ( | msg, | |
path | |||
) |
#define TOML_RETURNS_BY_THROWING |
#define utf8_buffered_reader_error_check | ( | ... | ) |
#define utf8_reader_error | ( | ... | ) | err_.emplace(__VA_ARGS__) |
#define utf8_reader_error_check | ( | ... | ) |
#define utf8_reader_return_after_error | ( | ... | ) | return __VA_ARGS__ |
|
noexcept |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::istream & | doc, |
std::string && | source_path | ||
) |
Parses a TOML document from a stream.
\detail \cpp std::stringstream ss; ss << "a = 3"sv;
auto tbl = toml::parse(ss, "foo.toml"); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::istream & | doc, |
std::string_view | source_path = {} |
||
) |
Parses a TOML document from a stream.
\detail \cpp std::stringstream ss; ss << "a = 3"sv;
auto tbl = toml::parse(ss); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::istream & | doc, |
std::wstring_view | source_path | ||
) |
Parses a TOML document from a stream.
\availability This overload is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
\detail \cpp std::stringstream ss; ss << "a = 3"sv;
auto tbl = toml::parse(ss); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::string_view | doc, |
std::string && | source_path | ||
) |
Parses a TOML document from a string view.
\detail \cpp auto tbl = toml::parse("a = 3"sv, "foo.toml"); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::string_view | doc, |
std::string_view | source_path = {} |
||
) |
Parses a TOML document from a string view.
\detail \cpp auto tbl = toml::parse("a = 3"sv); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse | ( | std::string_view | doc, |
std::wstring_view | source_path | ||
) |
Parses a TOML document from a string view.
\availability This overload is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
\detail \cpp auto tbl = toml::parse("a = 3"sv, L"foo.toml"); std::cout << tbl["a"] << "\n"; \ecpp
\out 3 \eout
doc | The TOML document to parse. Must be valid UTF-8. |
source_path | The path used to initialize each node's source().path . If you don't have a path (or you have no intention of using paths in diagnostics) then this parameter can safely be left blank. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse_file | ( | std::string_view | file_path | ) |
Parses a TOML document from a file.
\detail \cpp toml::parse_result get_foo_toml() { return toml::parse_file("foo.toml"); } \ecpp
file_path | The TOML document to parse. Must be valid UTF-8. |
TOML_EXTERNAL_LINKAGE parse_result TOML_CALLCONV parse_file | ( | std::wstring_view | file_path | ) |
Parses a TOML document from a file.
\availability This overload is only available when TOML_ENABLE_WINDOWS_COMPAT is enabled.
\detail \cpp toml::parse_result get_foo_toml() { return toml::parse_file(L"foo.toml"); } \ecpp
file_path | The TOML document to parse. Must be valid UTF-8. |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
utf8_reader | ( | std::basic_istream< Char > & | , |
std::string && | |||
) | -> utf8_reader< std::basic_istream< Char > > |
utf8_reader | ( | std::basic_istream< Char > & | , |
std::string_view | |||
) | -> utf8_reader< std::basic_istream< Char > > |
utf8_reader | ( | std::basic_string_view< Char > | , |
std::string && | |||
) | -> utf8_reader< std::basic_string_view< Char > > |
utf8_reader | ( | std::basic_string_view< Char > | , |
std::string_view | |||
) | -> utf8_reader< std::basic_string_view< Char > > |
TOML_ABI_NAMESPACE_END |
TOML_ANON_NAMESPACE_END |
TOML_ANON_NAMESPACE_START |
TOML_DISABLE_WARNINGS |
TOML_ENABLE_WARNINGS |
TOML_IMPL_NAMESPACE_END |
TOML_IMPL_NAMESPACE_START |
TOML_NAMESPACE_END |
TOML_NAMESPACE_START |
|
constexpr |