v0.1.8
|
A simple file utility. More...
Functions | |
Boolean | WriteText (const String &fileName, String string) |
Boolean | WriteData (const String &fileName, Byte *buffer, UInt32 size) |
void | ReadText (const String &fileName, String *result) |
Puts the file contents into a string. More... | |
void | ReadLines (const String &fileName, std::vector< String > *vector) |
Reads the contents of the file line-by-line, putting each line into a vector one-by-one. More... | |
void | ReadData (const String &fileName, Byte *buffer, UInt32 size) |
Reads the file into a byte buffer. More... | |
Boolean | GetFileSize (const String &fileName, UInt32 *fileSize) |
Obtains the size of a file. More... | |
UInt32 | GetFileSize (const String &fileName) |
Obtains the size of a file. More... | |
void | FindFiles (const String &path, FixedList< String > *files) |
void | FindDirectories (const String &path, FixedList< String > *directories) |
Boolean | Exists (const String &fileName) |
Checks if a file exists. More... | |
Enum | GetAccess (const String &fileName) |
Checks the permissions on a file. More... | |
UInt32 | CRC32 (const String &fileName) |
String | MD5 (const String &fileName) |
Boolean | IsDirectory (const String &fileName) |
Checks if the specified filename is a directory. More... | |
Boolean | IsFile (const String &fileName) |
Checks if the specified filename is a file. More... | |
Boolean | CreateDirectory (const String &fileName, bool recursive=false) |
Boolean | DeleteDirectory (const String &fileName, bool recursive=false) |
Boolean | DeleteFile (const String &fileName) |
Deletes the specified file. More... | |
Boolean | Copy (const String &fileName, const String &fileTo) |
Copies a file from one location to another. More... | |
Boolean | Move (const String &fileName, const String &fileTo) |
Moves a file from one location to another. More... | |
A simple file utility.
CGUL::Boolean CGUL::File::Copy | ( | const String & | fileName, |
const String & | fileTo | ||
) |
Copies a file from one location to another.
fileName | The target file. |
fileTo | The destination file. |
CGUL::Boolean CGUL::File::DeleteFile | ( | const String & | fileName | ) |
Deletes the specified file.
fileName | The file to delete. |
CGUL::Boolean CGUL::File::Exists | ( | const String & | fileName | ) |
Checks if a file exists.
fileName | The name of the file to check for. |
CGUL::Enum CGUL::File::GetAccess | ( | const String & | fileName | ) |
Checks the permissions on a file.
Determines the READ, WRITE, and EXECUTE permissions of the current user for the given file. Simply checking if a file exists is not enough information to know if that file can be operated on.
CGUL::Boolean CGUL::File::GetFileSize | ( | const String & | fileName, |
UInt32 * | fileSize | ||
) |
Obtains the size of a file.
fileName | The file to get the size of. |
fileSize | A pointer to an integer to put the size into. |
CGUL::UInt32 CGUL::File::GetFileSize | ( | const String & | fileName | ) |
Obtains the size of a file.
fileName | The file to get the size of. |
CGUL::Boolean CGUL::File::IsDirectory | ( | const String & | fileName | ) |
Checks if the specified filename is a directory.
fileName | The filename to check. |
CGUL::Boolean CGUL::File::IsFile | ( | const String & | fileName | ) |
Checks if the specified filename is a file.
fileName | The filename to check. |
CGUL::Boolean CGUL::File::Move | ( | const String & | fileName, |
const String & | fileTo | ||
) |
Moves a file from one location to another.
fileName | The target file. |
fileTo | The destination file. |
void CGUL::File::ReadData | ( | const String & | fileName, |
Byte * | buffer, | ||
UInt32 | size | ||
) |
Reads the file into a byte buffer.
fileName | The file to read. |
buffer | The buffer to copy the bytes into. |
size | The size of the buffer or the max amount of bytes to read. |
void CGUL::File::ReadLines | ( | const String & | fileName, |
std::vector< String > * | vector | ||
) |
Reads the contents of the file line-by-line, putting each line into a vector one-by-one.
fileName | The file to read. A pointer to the vector to append the lines to. |
void CGUL::File::ReadText | ( | const String & | fileName, |
CGUL::String * | result | ||
) |
Puts the file contents into a string.
fileName | The file to read. |
result | A pointer to the string to append the data to. |