os_filesystem.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief This is a header file with functions related to filesystem operations
7  *
8  * @file os_filesystem.hpp
9  */
10 #pragma once
11 
12 #include <ie_api.h>
13 
14 #ifdef ENABLE_UNICODE_PATH_SUPPORT
15 #include <codecvt>
16 #endif
17 
18 #include <locale>
19 #include <string>
20 
21 namespace InferenceEngine {
22 namespace details {
23 
24 template<typename C>
25 using enableIfSupportedChar = typename std::enable_if<(std::is_same<C, char>::value || std::is_same<C, wchar_t>::value)>::type;
26 
27 #ifdef ENABLE_UNICODE_PATH_SUPPORT
28 
29 /**
30  * @brief Conversion from wide character string to a single-byte chain.
31  */
32 inline const std::string wStringtoMBCSstringChar(const std::wstring& wstr) {
33  std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
34  return wstring_decoder.to_bytes(wstr);
35 }
36 
37 /**
38  * @brief Conversion from single-byte chain to wide character string.
39  */
40 inline const std::wstring multiByteCharToWString(const char* str) {
41  std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_encoder;
42  std::wstring result = wstring_encoder.from_bytes(str);
43  return result;
44 }
45 
46 #endif // ENABLE_UNICODE_PATH_SUPPORT
47 
48 } // namespace details
49 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS...
std::string type
Layer type.
Definition: ie_layers.h:47