-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[CORE] Refactor function signatures to use std::filesystem::path #31046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…for model and bin paths
@@ -176,42 +176,13 @@ inline int64_t file_size(const char* path) { | |||
* @param[in] path The file name | |||
* @return file size | |||
*/ | |||
inline bool file_exists(const char* path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will recommend to refactor this util function first and test it (as separate PR).
There is specific handing for android paths, I'm not sure if std implementation will work the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will recommend to refactor this util function first and test it (as separate PR). There is specific handing for android paths, I'm not sure if std implementation will work the same.
Refactor file_exists()
will be here: #31272
* @param properties Optional map of pairs: (property name, property value) relevant only for this read operation. | ||
* @return A model. | ||
*/ | ||
std::shared_ptr<ov::Model> read_model(const std::wstring& model_path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general direction should be to remove string versions (and is good) but they cannot be removed without
deprecation first (maybe only std::string versions could be removed).
The implementation should be done like std::filesystem::Path keeps main implementation and std::(w)string are just wrappers to create paths objects. The version with wstring can be useful to apply our internal util for wstring conversion to create paths objects. But it will requires testing which option is the best.
The internal classes/functions can use path object without deprecation, just requires proper handling
@@ -148,12 +148,12 @@ std::shared_ptr<ov::Model> read_model(const std::string& modelPath, | |||
return model; | |||
} | |||
|
|||
const auto fileExt = modelPath.substr(modelPath.find_last_of(".") + 1); | |||
const auto fileExt = model_path.substr(model_path.find_last_of(".") + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is dedicated member in path object to get extension
Details:
read_model()
file_exists()
Tickets: