UtiLite
0.3.1
A lite utilities library
|
#include <UFile.h>
Public Member Functions | |
UFile (const std::string &path) | |
bool | isValid () |
bool | exists () |
long | length () |
int | rename (const std::string &newName) |
std::string | getName () |
std::string | getExtension () |
void | copy (const std::string &to) |
Static Public Member Functions | |
static bool | exists (const std::string &filePath) |
static long | length (const std::string &filePath) |
static int | erase (const std::string &filePath) |
static int | rename (const std::string &oldFilePath, const std::string &newFilePath) |
static std::string | getName (const std::string &filePath) |
static std::string | getExtension (const std::string &filePath) |
static void | copy (const std::string &from, const std::string &to) |
Class UFile.
This class can be used to modify/erase files on hard drive.
UFile::UFile | ( | const std::string & | path | ) | [inline] |
Create a UFile object with path initialized to an existing file .
path | the path to an existing file |
void UFile::copy | ( | const std::string & | from, |
const std::string & | to | ||
) | [static] |
Copy a file.
from | the file path |
to | destination file path |
void UFile::copy | ( | const std::string & | to | ) | [inline] |
Copy a file.
to | destination file path |
int UFile::erase | ( | const std::string & | filePath | ) | [static] |
Erase a file.
filePath | the file path |
bool UFile::exists | ( | const std::string & | filePath | ) | [static] |
Check if a file exists.
filePath | the file path |
bool UFile::exists | ( | ) | [inline] |
Check if the file exists.
std::string UFile::getExtension | ( | const std::string & | filePath | ) | [static] |
Get the file extension.
std::string UFile::getExtension | ( | ) | [inline] |
Get the file extension.
std::string UFile::getName | ( | const std::string & | filePath | ) | [static] |
Get the file name from a file path (with extension).
filePath | the file path |
std::string UFile::getName | ( | ) | [inline] |
Get the file name without the path.
bool UFile::isValid | ( | ) | [inline] |
Check if the file exists. Same as exists().
long UFile::length | ( | const std::string & | filePath | ) | [static] |
Get the file length.
filePath | the file path |
long UFile::length | ( | ) | [inline] |
Get the length of the file.
int UFile::rename | ( | const std::string & | oldFilePath, |
const std::string & | newFilePath | ||
) | [static] |
Rename a file.
oldFilePath | the old file path |
newFilePath | the new file path |
int UFile::rename | ( | const std::string & | newName | ) | [inline] |
Rename the file name. The path stays the same.
the | new name |