Utility class to handle file functions.
More...
#include <Imt.Base.OS.WinEC7/FileUtil.h>
|
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...
|
|
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.
◆ 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
-
sourceFileName | The full file name (file path + filename) of the file to copy |
targetFileName | The full file name (file path + filename) of the new location of the file |
overwrite | If 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
-
fullDirectoryName | The 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
-
fileName | The 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
-
fullFileName | The 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
-
searchString | A 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
-
fullDirectoryName | The 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
-
fullFileName | The 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
-
fullFileName | The full file name (file path + filename) of the file to evaluate its size. |
fileSize | size in bytes |
- Returns
- true on success, false if failed.
The documentation for this class was generated from the following file:
- D:/_Work/10/s/Imt.Base/Imt.Base.OS.WinEC7/FileUtil.h