Dataflow Runtime API  3.0.3.0
Static Public Member Functions | List of all members
imt::base::os::winec7::FileUtil Class Reference

Utility class to handle file functions. More...

#include <Imt.Base.OS.WinEC7/FileUtil.h>

Static Public Member Functions

static bool createFile (const std::wstring &fileName)
 Creates a file. More...
 
static bool copyFile (const std::wstring &sourceFileName, const std::wstring &targetFileName, const bool overwrite)
 Copies an existing file to the given location. More...
 
static bool createDirectory (const std::wstring &fullDirectoryName)
 Creates a new and empty directory. More...
 
static bool exists (const std::wstring &fullFileName)
 Checks if a file exists. More...
 
static std::list< std::wstring > listFiles (const std::wstring &searchString)
 Returns a list of all files matching the search string. More...
 
static bool removeFile (const std::wstring &fullFileName)
 Removes an existing file. More...
 
static bool removeDirectory (const std::wstring &fullDirectoryName)
 Removes an existing and empty directory. More...
 
static bool size (const std::wstring &fullFileName, uint32_t &fileSize)
 Returns the size in bytes of the given file. More...
 

Detailed Description

Utility class to handle file functions.

Static class. Hint: For Windows CE no relative pathnames exists. So the full name of each file must be set.

Member Function Documentation

◆ copyFile()

static bool imt::base::os::winec7::FileUtil::copyFile ( const std::wstring &  sourceFileName,
const std::wstring &  targetFileName,
const bool  overwrite 
)
static

Copies an existing file to the given location.

Fails if the target directory or the source file does not exist. Also fails if there are no write permissions on the target directory.

Parameters
sourceFileNameThe full file name (file path + filename) of the file to copy
targetFileNameThe full file name (file path + filename) of the new location of the file
overwriteIf true an existing target file is overwritten, otherwise the operation fails
Returns
true if successfull, false otherwise

◆ createDirectory()

static bool imt::base::os::winec7::FileUtil::createDirectory ( const std::wstring &  fullDirectoryName)
static

Creates a new and empty directory.

Fails if the directory already exists, the path is invalid or if there are no write permissions on the target directory.

Parameters
fullDirectoryNameThe full name (path + name) of the directory to remove
Returns
true if successfull, false otherwise

◆ createFile()

static bool imt::base::os::winec7::FileUtil::createFile ( const std::wstring &  fileName)
static

Creates a file.

Parameters
fileNameThe name of the file to create.
Returns
true on success, false if failed.

◆ exists()

static bool imt::base::os::winec7::FileUtil::exists ( const std::wstring &  fullFileName)
static

Checks if a file exists.

Parameters
fullFileNameThe full file name (file path + filename) of the file to check if it exists
Returns
true if exists, false otherwise

◆ listFiles()

static std::list<std::wstring> imt::base::os::winec7::FileUtil::listFiles ( const std::wstring &  searchString)
static

Returns a list of all files matching the search string.

Parameters
searchStringA valid directory path that may include wildcards
Returns
The list of file paths found.

◆ removeDirectory()

static bool imt::base::os::winec7::FileUtil::removeDirectory ( const std::wstring &  fullDirectoryName)
static

Removes an existing and empty directory.

Fails if the directory is not empty or does not exist.

Parameters
fullDirectoryNameThe full name (path + name) of the directory to remove
Returns
true if successfull, false otherwise

◆ removeFile()

static bool imt::base::os::winec7::FileUtil::removeFile ( const std::wstring &  fullFileName)
static

Removes an existing file.

Fails if the file is open or if it does not exist.

Parameters
fullFileNameThe full file name (file path + filename) of the file to remove
Returns
true if successfull, false otherwise

◆ size()

static bool imt::base::os::winec7::FileUtil::size ( const std::wstring &  fullFileName,
uint32_t fileSize 
)
static

Returns the size in bytes of the given file.

Parameters
fullFileNameThe full file name (file path + filename) of the file to evaluate its size.
fileSizesize in bytes
Returns
true on success, false if failed.

The documentation for this class was generated from the following file: