Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-01 08:44:25

0001 // Copyright (c) 2017-2024, University of Cincinnati, developed by Henry Schreiner
0002 // under NSF AWARD 1414736 and by the respective contributors.
0003 // All rights reserved.
0004 //
0005 // SPDX-License-Identifier: BSD-3-Clause
0006 
0007 #pragma once
0008 
0009 // IWYU pragma: private, include "CLI/CLI.hpp"
0010 #include "Macros.hpp"
0011 
0012 // [CLI11:public_includes:set]
0013 #include <string>
0014 // [CLI11:public_includes:end]
0015 
0016 // [CLI11:encoding_includes:verbatim]
0017 #ifdef CLI11_CPP17
0018 #include <string_view>
0019 #endif  // CLI11_CPP17
0020 
0021 #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0
0022 #include <filesystem>
0023 #include <string_view>  // NOLINT(build/include)
0024 #endif                  // CLI11_HAS_FILESYSTEM
0025 // [CLI11:encoding_includes:end]
0026 
0027 namespace CLI {
0028 // [CLI11:encoding_hpp:verbatim]
0029 
0030 /// Convert a wide string to a narrow string.
0031 CLI11_INLINE std::string narrow(const std::wstring &str);
0032 CLI11_INLINE std::string narrow(const wchar_t *str);
0033 CLI11_INLINE std::string narrow(const wchar_t *str, std::size_t size);
0034 
0035 /// Convert a narrow string to a wide string.
0036 CLI11_INLINE std::wstring widen(const std::string &str);
0037 CLI11_INLINE std::wstring widen(const char *str);
0038 CLI11_INLINE std::wstring widen(const char *str, std::size_t size);
0039 
0040 #ifdef CLI11_CPP17
0041 CLI11_INLINE std::string narrow(std::wstring_view str);
0042 CLI11_INLINE std::wstring widen(std::string_view str);
0043 #endif  // CLI11_CPP17
0044 
0045 #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0
0046 /// Convert a char-string to a native path correctly.
0047 CLI11_INLINE std::filesystem::path to_path(std::string_view str);
0048 #endif  // CLI11_HAS_FILESYSTEM
0049 
0050 // [CLI11:encoding_hpp:end]
0051 }  // namespace CLI
0052 
0053 #ifndef CLI11_COMPILE
0054 #include "impl/Encoding_inl.hpp"  // IWYU pragma: export
0055 #endif