NeBuild dev
Loading...
Searching...
No Matches
std_string.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"
9#include <string_view>
10#include <string>
12
13#if TOML_DOXYGEN \
14 || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811 && defined(__cpp_lib_char8_t) \
15 && __cpp_lib_char8_t >= 201907)
16#define TOML_HAS_CHAR8 1
17#else
18#define TOML_HAS_CHAR8 0
19#endif
20
22
23namespace toml // non-abi namespace; this is not an error
24{
25 using namespace std::string_literals;
26 using namespace std::string_view_literals;
27}
28
29#if TOML_ENABLE_WINDOWS_COMPAT
30
32{
35 std::string narrow(std::wstring_view);
36
39 std::wstring widen(std::string_view);
40
41#if TOML_HAS_CHAR8
42
45 std::wstring widen(std::u8string_view);
46
47#endif
48}
50
51#endif // TOML_ENABLE_WINDOWS_COMPAT
52
#define TOML_EXPORTED_FREE_FUNCTION
An 'export' annotation to add to free functions. \detail Not defined by default.
Definition preprocessor.hpp:988
The root namespace for all toml++ functions and types.
Definition forward_declarations.hpp:199
#define TOML_NODISCARD
Definition preprocessor.hpp:439
#define TOML_IMPL_NAMESPACE_END
Definition preprocessor.hpp:1334
#define TOML_IMPL_NAMESPACE_START
Definition preprocessor.hpp:1333
TOML_ENABLE_WARNINGS
Definition std_string.hpp:11
TOML_DISABLE_WARNINGS
Definition std_string.hpp:8