The system file access class. More...
#include "murl_system_file.h"
Public Member Functions | |
File () | |
The default constructor. | |
virtual | ~File () |
The destructor. More... | |
Bool | Open (const String &fileName, IEnums::FileAccessMode mode=IEnums::FILE_ACCESS_MODE_READ_ONLY) |
Open a file. More... | |
Bool | Close () |
Close the file. More... | |
Bool | IsOpen () const |
Check if the file is open. More... | |
UInt64 | GetSize () const |
Get the size of the file. More... | |
UInt64 | GetPosition () const |
Get the file pointer position. More... | |
void | SetPosition (UInt64 position) |
Set the file pointer position. More... | |
UInt64 | Read (void *data, UInt64 byteSize) |
Read from the file at the current file pointer position. More... | |
UInt64 | Write (const void *data, UInt64 byteSize) |
Write to the file at the current file pointer position. More... | |
Static Public Member Functions | |
static StringArray | GetFiles (const String &path) |
Get all file names from a specified path. More... | |
static Bool | FileExists (const String &path) |
Check if a file exists. More... | |
static Bool | DeleteFile (const String &path) |
Delete a file. More... | |
static Bool | MoveFile (const String &oldPath, const String &newPath) |
Move/rename a file. More... | |
static UInt64 | GetFileSize (const String &path) |
Get the size of a file in bytes. More... | |
static StringArray | GetFolders (const String &path) |
Get all folder names from a specified path. More... | |
static Bool | FolderExists (const String &path) |
Check if a folder exists. More... | |
static Bool | CreateFolder (const String &path) |
Create a folder. More... | |
static Bool | DeleteFolder (const String &path, Bool recursively) |
Delete a folder. More... | |
static Bool | MoveFolder (const String &oldPath, const String &newPath) |
Move/rename a folder. More... | |
static Bool | GetItemCreationTime (const String &path, Time &time) |
Get the creation time of a file or folder. More... | |
static Bool | GetItemModificationTime (const String &path, Time &time) |
Get the time a file or folder was most recently modified. More... | |
Protected Attributes | |
FileHandle * | mHandle |
The anonymous file handle for internal use only. | |
IEnums::FileAccessMode | mMode |
The mode used for opening the file. | |
Detailed Description
The system file access class.
Constructor & Destructor Documentation
◆ ~File()
|
virtual |
The destructor.
Close the file if open.
Member Function Documentation
◆ GetFiles()
|
static |
Get all file names from a specified path.
- Parameters
-
path The path to examine the files.
- Returns
- A string array containing all files names.
◆ FileExists()
Check if a file exists.
- Parameters
-
path The path and filename.
- Returns
- true if the file exists.
◆ DeleteFile()
Delete a file.
- Parameters
-
path The path to the file to delete.
- Returns
- true if successful.
◆ MoveFile()
Move/rename a file.
- Parameters
-
oldPath The current path to the file to move. newPath The new path of the file.
- Returns
- true if successful.
◆ GetFileSize()
Get the size of a file in bytes.
- Parameters
-
path The path to the file to check.
- Returns
- The file's size in bytes.
◆ GetFolders()
|
static |
Get all folder names from a specified path.
- Parameters
-
path The path to examine the folders.
- Returns
- A string array containing all folder names.
◆ FolderExists()
Check if a folder exists.
- Parameters
-
path The path and the folder.
- Returns
- true if the folder exists.
◆ CreateFolder()
Create a folder.
- Parameters
-
path The path and the folder to create.
- Returns
- true if successful.
◆ DeleteFolder()
Delete a folder.
- Parameters
-
path The path and the folder to delete. recursively If true, the folder and all contents are deleted. If false, the function fails when the folder is not empty.
- Returns
- true if successful.
◆ MoveFolder()
|
static |
Move/rename a folder.
- Parameters
-
oldPath The current path to the folder to move. newPath The new path of the folder.
- Returns
- true if successful.
◆ GetItemCreationTime()
Get the creation time of a file or folder.
- Parameters
-
path The path to the file or folder to query. time A reference to a time object to receive the creation time.
- Returns
- true if successful.
◆ GetItemModificationTime()
Get the time a file or folder was most recently modified.
- Parameters
-
path The path to the file or folder to query. time A reference to a time object to receive the last modification time.
- Returns
- true if successful.
◆ Open()
Bool Murl::System::File::Open | ( | const String & | fileName, |
IEnums::FileAccessMode | mode = IEnums::FILE_ACCESS_MODE_READ_ONLY |
||
) |
Open a file.
- Parameters
-
fileName The file name to open. mode The access mode for opening the file.
- Returns
- true if successful.
◆ Close()
Bool Murl::System::File::Close | ( | ) |
Close the file.
- Returns
- true if successful.
◆ IsOpen()
Bool Murl::System::File::IsOpen | ( | ) | const |
Check if the file is open.
- Returns
- true if the file is open.
◆ GetSize()
UInt64 Murl::System::File::GetSize | ( | ) | const |
Get the size of the file.
- Returns
- The byte size of the file.
◆ GetPosition()
UInt64 Murl::System::File::GetPosition | ( | ) | const |
Get the file pointer position.
- Returns
- The file pointer position in bytes.
◆ SetPosition()
void Murl::System::File::SetPosition | ( | UInt64 | position | ) |
Set the file pointer position.
- Parameters
-
position The file pointer position in bytes.
◆ Read()
Read from the file at the current file pointer position.
- Parameters
-
data Pointer to the memory to read into. byteSize The byte size of the memory.
- Returns
- The number of bytes read from the file.
◆ Write()
Write to the file at the current file pointer position.
- Parameters
-
data Pointer to the memory to read from. byteSize The byte size of the memory.
- Returns
- The number of bytes written to the file.
The documentation for this class was generated from the following file:
- murl_system_file.h