Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
parser.hpp
Go to the documentation of this file.
1// # This file is a part of toml++ and is subject to the the terms of the MIT license.
2// # Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
3// # See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
4// SPDX-License-Identifier: MIT
5#pragma once
6
7#include "preprocessor.hpp"
8#if TOML_ENABLE_PARSER
9
10#include "header_start.hpp"
11#include "parse_result.hpp"
12#include "table.hpp"
13
16
39 parse_result TOML_CALLCONV parse(std::string_view doc, std::string_view source_path = {});
40
63 parse_result TOML_CALLCONV parse(std::string_view doc, std::string && source_path);
64
82 parse_result TOML_CALLCONV parse_file(std::string_view file_path);
83
84#if TOML_HAS_CHAR8
85
108 parse_result TOML_CALLCONV parse(std::u8string_view doc, std::string_view source_path = {});
109
132 parse_result TOML_CALLCONV parse(std::u8string_view doc, std::string && source_path);
133
151 parse_result TOML_CALLCONV parse_file(std::u8string_view file_path);
152
153#endif // TOML_HAS_CHAR8
154
155#if TOML_ENABLE_WINDOWS_COMPAT
156
181 parse_result TOML_CALLCONV parse(std::string_view doc, std::wstring_view source_path);
182
210 parse_result TOML_CALLCONV parse(std::istream & doc, std::wstring_view source_path);
211
231 parse_result TOML_CALLCONV parse_file(std::wstring_view file_path);
232
233#endif // TOML_ENABLE_WINDOWS_COMPAT
234
235#if TOML_HAS_CHAR8 && TOML_ENABLE_WINDOWS_COMPAT
236
261 parse_result TOML_CALLCONV parse(std::u8string_view doc, std::wstring_view source_path);
262
263#endif // TOML_HAS_CHAR8 && TOML_ENABLE_WINDOWS_COMPAT
264
290 parse_result TOML_CALLCONV parse(std::istream & doc, std::string_view source_path = {});
291
317 parse_result TOML_CALLCONV parse(std::istream & doc, std::string && source_path);
318
319 TOML_ABI_NAMESPACE_END; // TOML_EXCEPTIONS
320
321 inline namespace literals {
323
346 parse_result operator"" _toml(const char* str, size_t len) {
347 return parse(std::string_view{str, len});
348 }
349
350#if TOML_HAS_CHAR8
351
374 parse_result operator"" _toml(const char8_t* str, size_t len) {
375 return parse(std::u8string_view{str, len});
376 }
377
378#endif // TOML_HAS_CHAR8
379
380 TOML_ABI_NAMESPACE_END; // TOML_EXCEPTIONS
381 } // namespace literals
382}
384
385#include "header_end.hpp"
386#endif // TOML_ENABLE_PARSER
#define len
Definition 17.names.cpp:488
The result of a parsing operation.
const char * str
Definition exec.cpp:170
#define TOML_CALLCONV
Calling convention to apply to exported free/static functions. \detail Not defined by default (let th...
#define TOML_EXCEPTIONS
Sets whether the library uses exceptions to report parsing failures. \detail Defaults to 1 or 0 accor...
#define TOML_EXPORTED_FREE_FUNCTION
An 'export' annotation to add to free functions. \detail Not defined by default.
TOML_ABI_NAMESPACE_END
Definition parser.hpp:380
TOML_NAMESPACE_START
Definition parser.hpp:14
TOML_NODISCARD TOML_EXPORTED_FREE_FUNCTION parse_result TOML_CALLCONV parse_file(std::string_view file_path)
Parses a TOML document from a file.
Definition parser.inl:3447
TOML_ABI_NAMESPACE_END
Definition parser.hpp:319
TOML_NODISCARD TOML_EXPORTED_FREE_FUNCTION parse_result TOML_CALLCONV parse(std::string_view doc, std::string_view source_path={})
Parses a TOML document from a string view.
Definition parser.inl:3425
TOML_NAMESPACE_END
Definition parser.hpp:383
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F)
#define TOML_NODISCARD
#define TOML_ALWAYS_INLINE