Functions

Utility functions to work with files, UNICODE support. More...

Functions

std::string FileUtils::absoluteFilePath (const std::string &filePath)
 Interface function to get absolute path of file. More...
 
void FileUtils::createDirectoryRecursive (const std::string &dirPath)
 Interface function to create directorty recursively by given path. More...
 
bool FileUtils::directoryExists (const std::string &path)
 Interface function to check if directory exists for given path. More...
 
long long FileUtils::fileSize (const char *fileName)
 Interface function to get the size of a file. The function supports UNICODE path. More...
 
template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
long long FileUtils::fileSize (const std::basic_string< C > &f)
 Function to get the size of a file. The function supports UNICODE path. More...
 
template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
bool FileUtils::fileExist (const C *fileName)
 check if file with a given filename exists. The function supports UNICODE path More...
 
template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
bool FileUtils::fileExist (const std::basic_string< C > &fileName)
 check if file with a given filename exists. The function supports UNICODE path More...
 
template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
std::basic_string< CFileUtils::makePath (const std::basic_string< C > &folder, const std::basic_string< C > &file)
 CPP Interface function to combint path with filename. The function supports UNICODE path. More...
 
template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
std::basic_string< CFileUtils::fileExt (const std::basic_string< C > &filename)
 CPP Interface function to extract extension from filename. More...
 
std::string InferenceEngine::getIELibraryPath ()
 Returns a path to Inference Engine library. More...
 

Detailed Description

Utility functions to work with files, UNICODE support.

Function Documentation

◆ absoluteFilePath()

std::string FileUtils::absoluteFilePath ( const std::string &  filePath)

Interface function to get absolute path of file.

Parameters
filePath- path to file, can be relative to current working directory
Returns
Absolute path of file
Exceptions
InferenceEngine::Exceptionif any error occurred

◆ createDirectoryRecursive()

void FileUtils::createDirectoryRecursive ( const std::string &  dirPath)

Interface function to create directorty recursively by given path.

Parameters
dirPath- path to file, can be relative to current working directory
Exceptions
InferenceEngine::Exceptionif any error occurred

◆ directoryExists()

bool FileUtils::directoryExists ( const std::string &  path)

Interface function to check if directory exists for given path.

Parameters
path- path to directory
Returns
true if directory exists, false otherwise

◆ fileExist() [1/2]

template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
bool FileUtils::fileExist ( const C fileName)
inline

check if file with a given filename exists. The function supports UNICODE path

Parameters
fileName- given filename
Returns
true is exists

◆ fileExist() [2/2]

template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
bool FileUtils::fileExist ( const std::basic_string< C > &  fileName)
inline

check if file with a given filename exists. The function supports UNICODE path

Parameters
fileName- string with a given filename
Returns
true is exists

◆ fileExt()

template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
std::basic_string<C> FileUtils::fileExt ( const std::basic_string< C > &  filename)
inline

CPP Interface function to extract extension from filename.

Parameters
filename- string with the name of the file which extension should be extracted
Returns
string with extracted file extension

◆ fileSize() [1/2]

long long FileUtils::fileSize ( const char *  fileName)

Interface function to get the size of a file. The function supports UNICODE path.

Parameters
fileName- name of the file
Returns
size of the file

◆ fileSize() [2/2]

template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
long long FileUtils::fileSize ( const std::basic_string< C > &  f)
inline

Function to get the size of a file. The function supports UNICODE path.

Parameters
f- string name of the file
Returns
size of the file

◆ getIELibraryPath()

std::string InferenceEngine::getIELibraryPath ( )

Returns a path to Inference Engine library.

Returns
A std::string path to Inference Engine library

◆ makePath()

template<typename C , typename = InferenceEngine::details::enableIfSupportedChar<C>>
std::basic_string<C> FileUtils::makePath ( const std::basic_string< C > &  folder,
const std::basic_string< C > &  file 
)
inline

CPP Interface function to combint path with filename. The function supports UNICODE path.

Parameters
folder- path to add filename to
file- filename to add to path
Returns
string with combination of the path and the filename divided by file separator