PixelLightAPI
.
|
Base class for files and directories. More...
#include <FileObject.h>
Public Member Functions | |
FileObject () | |
Constructor. | |
FileObject (const String &sUrl, const FileAccess *pAccess=nullptr) | |
Constructor. | |
FileObject (const Url &cUrl, const FileAccess *pAccess=nullptr) | |
Constructor. | |
virtual | ~FileObject () |
Destructor. | |
void | Assign (const String &sUrl, const FileAccess *pAccess=nullptr) |
Assign a new URL. | |
PLCORE_API void | Assign (const Url &cUrl, const FileAccess *pAccess=nullptr) |
Assign a new URL. | |
PLCORE_API void | Assign (FILE *pFile, uint32 nAccess) |
Assign a new file. | |
PLCORE_API void | Assign (handle hFile) |
Assign a new file. | |
const Url & | GetUrl () const |
Get URL. | |
bool | Exists () const |
Check if the file or directory exists. | |
bool | IsFile () const |
Returns if the object is a regular file. | |
bool | IsDirectory () const |
Returns if the object is a directory. | |
bool | Copy (const String &sDestination, bool bOverwrite=false) const |
Copy the file or directory to a new location. | |
bool | Move (const String &sDestination) |
Move the file or directory to a new location. | |
bool | Rename (const String &sName) |
Rename the file or directory. | |
void | Close () |
Close the file or directory. | |
Protected Member Functions | |
PLCORE_API | FileObject (FILE *pFile, uint32 nAccess) |
Constructor for a standard OS stream. | |
PLCORE_API | FileObject (handle hFile) |
Constructor for a OS file handle. | |
PLCORE_API bool | GenericCopy (const String &sDestination, bool bOverwrite=false) const |
Generic implementation of 'Copy()' (if system-implementation does not work) | |
PLCORE_API bool | GenericMove (const String &sDestination) |
Generic implementation of 'Move()' (if system-implementation does not work) | |
Protected Attributes | |
FileImpl * | m_pFileImpl |
Url | m_cNullUrl |
Base class for files and directories.
PLCore::FileObject::FileObject | ( | ) | [inline] |
PLCore::FileObject::FileObject | ( | const String & | sUrl, |
const FileAccess * | pAccess = nullptr |
||
) | [inline] |
[in] | sUrl | URL of the file or directory |
[in] | pAccess | Additional file access information (can be a null pointer) |
PLCore::FileObject::FileObject | ( | const Url & | cUrl, |
const FileAccess * | pAccess = nullptr |
||
) | [inline] |
[in] | cUrl | URL of the file or directory |
[in] | pAccess | Additional file access information (can be a null pointer) |
PLCore::FileObject::~FileObject | ( | ) | [inline, virtual] |
Destructor.
PLCore::FileObject::FileObject | ( | FILE * | pFile, |
uint32 | nAccess | ||
) | [inline, protected] |
Constructor for a standard OS stream.
[in] | pFile | Standard stream pointer |
[in] | nAccess | Access flags that were used to open the stream |
PLCore::FileObject::FileObject | ( | handle | hFile | ) | [inline, protected] |
Constructor for a OS file handle.
[in] | hFile | OS file handle |
void PLCore::FileObject::Assign | ( | const String & | sUrl, |
const FileAccess * | pAccess = nullptr |
||
) | [inline] |
Assign a new URL.
[in] | sUrl | URL of the file or directory |
[in] | pAccess | Additional file access information (can be a null pointer) |
PLCORE_API void PLCore::FileObject::Assign | ( | const Url & | cUrl, |
const FileAccess * | pAccess = nullptr |
||
) |
Assign a new URL.
[in] | cUrl | URL of the file or directory |
[in] | pAccess | Additional file access information (can be a null pointer) |
PLCORE_API void PLCore::FileObject::Assign | ( | FILE * | pFile, |
uint32 | nAccess | ||
) |
Assign a new file.
[in] | pFile | Standard stream pointer |
[in] | nAccess | Access flags that were used to open the stream |
PLCORE_API void PLCore::FileObject::Assign | ( | handle | hFile | ) |
Assign a new file.
[in] | hFile | OS file handle |
const Url & PLCore::FileObject::GetUrl | ( | ) | const [inline] |
Get URL.
bool PLCore::FileObject::Exists | ( | ) | const [inline] |
Check if the file or directory exists.
bool PLCore::FileObject::IsFile | ( | ) | const [inline] |
Returns if the object is a regular file.
Returns if the object is a file.
bool PLCore::FileObject::IsDirectory | ( | ) | const [inline] |
Returns if the object is a directory.
bool PLCore::FileObject::Copy | ( | const String & | sDestination, |
bool | bOverwrite = false |
||
) | const [inline] |
Copy the file or directory to a new location.
[in] | sDestination | URL of the destination |
[in] | bOverwrite | Shall the file be overwritten if it already exists? |
bool PLCore::FileObject::Move | ( | const String & | sDestination | ) | [inline] |
Move the file or directory to a new location.
[in] | sDestination | URL of the destination |
bool PLCore::FileObject::Rename | ( | const String & | sName | ) | [inline] |
Rename the file or directory.
[in] | sName | New filename (filename only, no path) |
void PLCore::FileObject::Close | ( | ) | [inline] |
Close the file or directory.
Reimplemented in PLCore::File.
PLCORE_API bool PLCore::FileObject::GenericCopy | ( | const String & | sDestination, |
bool | bOverwrite = false |
||
) | const [protected] |
Generic implementation of 'Copy()' (if system-implementation does not work)
[in] | sDestination | URL of the destination |
[in] | bOverwrite | Shall the file be overwritten if it already exists? |
PLCORE_API bool PLCore::FileObject::GenericMove | ( | const String & | sDestination | ) | [protected] |
Generic implementation of 'Move()' (if system-implementation does not work)
[in] | sDestination | URL of the destination |
FileImpl* PLCore::FileObject::m_pFileImpl [protected] |
Platform implementation for file object (can be a null pointer)
Url PLCore::FileObject::m_cNullUrl [protected] |
Empty URL
|