Skip to content

Commit

Permalink
deprecate old file_size function and provide alternative usage guidance
Browse files Browse the repository at this point in the history
  • Loading branch information
barnasm1 committed Jan 16, 2025
1 parent 2e7cf52 commit e9c2cca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/common/util/include/openvino/util/file_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ inline ov::util::Path cut_android_path(const ov::util::Path& file_name) {
* @param[in] path The file name
* @return file size
*/
[[deprecated(
"This function is deprecated use file_size(const ov::util::Path& path) instead. Will be removed in 2026.0")]]
inline int64_t file_size(const char* path) {
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
std::wstring widefilename = ov::util::string_to_wstring(path);
const wchar_t* file_name = widefilename.c_str();
#elif defined(__ANDROID__) || defined(ANDROID)
std::string file_name = path;
std::string::size_type pos = file_name.find('!');
if (pos != std::string::npos) {
file_name = file_name.substr(0, pos);
}
#else
const char* file_name = path;
#endif
std::ifstream in(file_name, std::ios_base::binary | std::ios_base::ate);
return in.tellg();
}

inline int64_t file_size(const ov::util::Path& path) {
#if defined(__ANDROID__) || defined(ANDROID)
const ov::util::Path& cut_path = cut_android_path(path);
Expand Down

0 comments on commit e9c2cca

Please sign in to comment.