os_filesystem.hpp
1 // Copyright (C) 2018-2019 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  * @file os_filesystem.h
8  */
9 #pragma once
10 
11 #ifdef ENABLE_UNICODE_PATH_SUPPORT
12 #include <string>
13 #include <codecvt>
14 #include <locale>
15 
16 namespace InferenceEngine {
17 namespace details {
18 
19 /**
20 * @brief Conversion from wide character string to a single-byte chain.
21 */
22 inline const std::string wStringtoMBCSstringChar(const std::wstring& wstr) {
23  std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
24  return wstring_decoder.to_bytes(wstr);
25 }
26 
27 /**
28 * @brief Conversion from single-byte chain to wide character string.
29 */
30 inline const std::wstring multiByteCharToWString(const char* str) {
31  std::wstring_convert<std::codecvt_utf8 <wchar_t>> wstring_encoder;
32  std::wstring result = wstring_encoder.from_bytes(str);
33  return result;
34 }
35 
36 } // namespace details
37 } // namespace InferenceEngine
38 
39 #endif
Definition: ie_argmax_layer.hpp:11