OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[Core] Migrate remaining core path handling to std::filesystem::path (#34889)
Alicja Miloszewskadce5b81deaf1
diff --git a/src/core/dev_api/openvino/core/so_extension.hpp b/src/core/dev_api/openvino/core/so_extension.hppindex 672da138e6c..8fd90859de6 100644--- a/src/core/dev_api/openvino/core/so_extension.hpp+++ b/src/core/dev_api/openvino/core/so_extension.hpp@@ -55,9 +55,5 @@ inline std::vector<Extension::Ptr> load_extensions(const std::filesystem::path&return load_extensions(so);}-template <class T>-inline std::vector<Extension::Ptr> load_extensions(const std::basic_string<T>& path) {- return load_extensions(ov::util::make_path(path));-}} // namespace detail} // namespace ovdiff --git a/src/core/src/graph_util.cpp b/src/core/src/graph_util.cppindex 1ed6cc86c56..ba031ae29c4 100644--- a/src/core/src/graph_util.cpp+++ b/src/core/src/graph_util.cpp@@ -334,7 +334,7 @@ void save_model(const std::shared_ptr<const ov::Model>& m,#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT)void save_model(const std::shared_ptr<const ov::Model>& m, const std::wstring& output_model, bool compress_to_fp16) {- save_model(m, ov::util::wstring_to_string(output_model), compress_to_fp16);+ save_model(m, ov::util::make_path(output_model), compress_to_fp16);}#endifdiff --git a/src/core/tests/extension.cpp b/src/core/tests/extension.cppindex 42e81efd255..d9ac4e731b4 100644--- a/src/core/tests/extension.cpp+++ b/src/core/tests/extension.cpp@@ -5,7 +5,8 @@#include "openvino/core/extension.hpp"#include <gtest/gtest.h>-#include <stdio.h>++#include <filesystem>#include "common_test_utils/file_utils.hpp"#include "openvino/core/graph_util.hpp"@@ -13,9 +14,10 @@#include "openvino/core/so_extension.hpp"#include "openvino/util/file_util.hpp"-inline std::string get_extension_path() {- return ov::util::make_plugin_library_name<char>(ov::test::utils::getExecutableDirectory(),- std::string("openvino_template_extension") + OV_BUILD_POSTFIX);+inline std::filesystem::path get_extension_path() {+ return ov::util::make_plugin_library_name(+ ov::util::make_path(ov::test::utils::getExecutableDirectory()),+ std::filesystem::path("openvino_template_extension").concat(OV_BUILD_POSTFIX));}inline std::wstring get_extension_wdir() {@@ -37,9 +39,9 @@ TEST(extension, load_extension_wstring) {std::wstring wdir_ext_path = wdir + ov::util::string_to_wstring(ov::util::make_plugin_library_name<char>("",std::string("openvino_template_extension") + OV_BUILD_POSTFIX));- _wrename(ov::util::string_to_wstring(get_extension_path()).c_str(), wdir_ext_path.c_str());- EXPECT_NO_THROW(ov::detail::load_extensions(wdir_ext_path));- _wrename(wdir_ext_path.c_str(), ov::util::string_to_wstring(get_extension_path()).c_str());+ _wrename(get_extension_path().c_str(), wdir_ext_path.c_str());+ EXPECT_NO_THROW(ov::detail::load_extensions(ov::util::make_path(wdir_ext_path)));+ _wrename(wdir_ext_path.c_str(), get_extension_path().c_str());_wrmdir(wdir.c_str());}#endifdiff --git a/src/frontends/common/src/manager.cpp b/src/frontends/common/src/manager.cppindex 6e0fb945fd9..d414854820b 100644--- a/src/frontends/common/src/manager.cpp+++ b/src/frontends/common/src/manager.cpp@@ -107,9 +107,8 @@ public:}void register_front_end(const std::string& name, const std::filesystem::path& library_path) {- auto lib_path = ov::util::get_plugin_path(library_path);PluginInfo plugin;- plugin.m_file_path = ov::util::get_plugin_path(ov::util::make_path(library_path));+ plugin.m_file_path = ov::util::get_plugin_path(library_path);plugin.m_file_name = plugin.m_file_path.filename();FRONT_END_GENERAL_CHECK(plugin.load(), "Cannot load frontend ", plugin.get_name_from_file());std::lock_guard<std::mutex> guard(m_loading_mutex);