2021-10-24 22:04:23 +00:00
|
|
|
//# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
|
|
|
//# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
|
|
|
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "preprocessor.h"
|
|
|
|
TOML_DISABLE_WARNINGS;
|
|
|
|
#include <string_view>
|
|
|
|
#include <string>
|
|
|
|
TOML_ENABLE_WARNINGS;
|
|
|
|
|
|
|
|
#if defined(DOXYGEN) \
|
|
|
|
|| (defined(__cpp_char8_t) && __cpp_char8_t >= 201811 && defined(__cpp_lib_char8_t) \
|
|
|
|
&& __cpp_lib_char8_t >= 201907)
|
|
|
|
#define TOML_HAS_CHAR8 1
|
|
|
|
#else
|
|
|
|
#define TOML_HAS_CHAR8 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/// \cond
|
|
|
|
|
|
|
|
namespace toml // non-abi namespace; this is not an error
|
|
|
|
{
|
|
|
|
using namespace std::string_literals;
|
|
|
|
using namespace std::string_view_literals;
|
|
|
|
}
|
|
|
|
|
2021-10-30 14:26:05 +00:00
|
|
|
#if TOML_ENABLE_WINDOWS_COMPAT
|
2021-10-24 22:04:23 +00:00
|
|
|
|
|
|
|
TOML_IMPL_NAMESPACE_START
|
|
|
|
{
|
|
|
|
TOML_NODISCARD
|
2022-02-12 12:25:43 +00:00
|
|
|
TOML_EXPORTED_FREE_FUNCTION
|
2021-10-26 18:03:56 +00:00
|
|
|
std::string narrow(std::wstring_view);
|
2021-10-24 22:04:23 +00:00
|
|
|
|
|
|
|
TOML_NODISCARD
|
2022-02-12 12:25:43 +00:00
|
|
|
TOML_EXPORTED_FREE_FUNCTION
|
2021-10-26 18:03:56 +00:00
|
|
|
std::wstring widen(std::string_view);
|
2021-10-24 22:04:23 +00:00
|
|
|
|
|
|
|
#if TOML_HAS_CHAR8
|
|
|
|
|
|
|
|
TOML_NODISCARD
|
2022-02-12 12:25:43 +00:00
|
|
|
TOML_EXPORTED_FREE_FUNCTION
|
2021-10-26 18:03:56 +00:00
|
|
|
std::wstring widen(std::u8string_view);
|
2021-10-24 22:04:23 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
TOML_IMPL_NAMESPACE_END;
|
|
|
|
|
2021-10-30 14:26:05 +00:00
|
|
|
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
2021-10-24 22:04:23 +00:00
|
|
|
|
|
|
|
/// \endcond
|