summaryrefslogtreecommitdiffhomepage
path: root/vendor/toml++/impl/std_string.hpp
blob: 523066186d3fee1031e14cf78029836a174bc427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// # 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.hpp"
TOML_DISABLE_WARNINGS;
#include <string>
#include <string_view>
TOML_ENABLE_WARNINGS;

#if TOML_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;
}  // namespace toml

#if TOML_ENABLE_WINDOWS_COMPAT

TOML_IMPL_NAMESPACE_START {
  TOML_NODISCARD
  TOML_EXPORTED_FREE_FUNCTION
  std::string narrow(std::wstring_view);

  TOML_NODISCARD
  TOML_EXPORTED_FREE_FUNCTION
  std::wstring widen(std::string_view);

#if TOML_HAS_CHAR8

  TOML_NODISCARD
  TOML_EXPORTED_FREE_FUNCTION
  std::wstring widen(std::u8string_view);

#endif
}
TOML_IMPL_NAMESPACE_END;

#endif  // TOML_ENABLE_WINDOWS_COMPAT

/// \endcond