1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief This is a header file with common inference engine definitions.
17 #include <details/ie_exception.hpp>
20 typedef wchar_t tchar;
21 typedef std::wstring file_name_t;
24 typedef std::string file_name_t;
27 namespace InferenceEngine {
30 * @brief Conversion from possibly-wide character string to a single-byte chain.
32 inline std::string fileNameToString(const file_name_t& str) {
34 size_t maxlen = (str.length() + 1) * sizeof(wchar_t) / sizeof(char);
35 std::vector<char> mbstr(maxlen);
37 std::wcstombs(&mbstr[0], str.c_str(), maxlen);
38 std::string res = std::string(&mbstr[0]);
46 * @brief Conversion from single-byte character string to a possibly-wide one
48 inline file_name_t stringToFileName(const std::string& str) {
50 size_t maxlen = str.length() + 1;
51 std::vector<wchar_t> wcstr(maxlen);
53 std::mbstowcs(&wcstr[0], str.c_str(), maxlen);
54 file_name_t res = file_name_t(&wcstr[0]);
61 } // namespace InferenceEngine