1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * @brief This is a header file with common inference engine definitions
14 #include <details/ie_exception.hpp>
21 typedef wchar_t tchar;
22 typedef std::wstring file_name_t;
25 typedef std::string file_name_t;
28 namespace InferenceEngine {
31 * @brief Conversion from possibly-wide character string to a single-byte chain.
33 inline std::string fileNameToString(const file_name_t& str) {
35 size_t maxlen = (str.length() + 1) * sizeof(wchar_t) / sizeof(char);
36 std::vector<char> mbstr(maxlen);
38 std::wcstombs(&mbstr[0], str.c_str(), maxlen);
39 std::string res = std::string(&mbstr[0]);
47 * @brief Conversion from single-byte character string to a possibly-wide one
49 inline file_name_t stringToFileName(const std::string& str) {
51 size_t maxlen = str.length() + 1;
52 std::vector<wchar_t> wcstr(maxlen);
54 std::mbstowcs(&wcstr[0], str.c_str(), maxlen);
55 file_name_t res = file_name_t(&wcstr[0]);
62 } // namespace InferenceEngine