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 #include <ie_api.h>
12 
13 #ifdef ENABLE_UNICODE_PATH_SUPPORT
14 
15 #include <codecvt>
16 #include <locale>
17 #include <string>
18 
19 namespace InferenceEngine {
20 namespace details {
21 
22 /**
23  * @brief Conversion from wide character string to a single-byte chain.
24  */
25 inline const std::string wStringtoMBCSstringChar(const std::wstring& wstr) {
26  std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_decoder;
27  return wstring_decoder.to_bytes(wstr);
28 }
29 
30 /**
31  * @brief Conversion from single-byte chain to wide character string.
32  */
33 inline const std::wstring multiByteCharToWString(const char* str) {
34  std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_encoder;
35  std::wstring result = wstring_encoder.from_bytes(str);
36  return result;
37 }
38 
39 } // namespace details
40 } // namespace InferenceEngine
41 
42 #endif // ENABLE_UNICODE_PATH_SUPPORT
Inference Engine API.
Definition: ie_argmax_layer.hpp:11
The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS...