PixelLightAPI
.
|
Abstract base class for platform specific file object implementations. More...
#include <FileImpl.h>
Protected Member Functions | |
PLCORE_API | FileImpl (const Url &cUrl, const FileAccess *pAccess) |
Constructor. | |
virtual PLCORE_API | ~FileImpl () |
Destructor. | |
virtual bool | Exists () const =0 |
Check if the file or directory exists. | |
virtual bool | IsFile () const =0 |
Check if the object is a regular file. | |
virtual bool | IsDirectory () const =0 |
Check if the object is a directory. | |
virtual bool | CopyTo (const String &sDest, bool bOverwrite) const =0 |
Copy the file or directory to a new location. | |
virtual bool | MoveTo (const String &sDest)=0 |
Move the file or directory to a new location. | |
virtual bool | Rename (const String &sName)=0 |
Rename the file or directory. | |
virtual bool | CreateNewFile (bool bAlways)=0 |
Create a file. | |
virtual bool | CreateNewDirectory ()=0 |
Create a directory. | |
virtual bool | Delete ()=0 |
Delete a file. | |
virtual bool | DeleteDirectory ()=0 |
Delete a directory. | |
virtual void | Close ()=0 |
Close the file or directory. | |
virtual bool | Open (uint32 nAccess, String::EFormat nStringFormat=String::ASCII)=0 |
Open the file for reading and/or writing. | |
virtual bool | IsOpen () const =0 |
Returns whether the file is open. | |
virtual bool | IsReadable () const =0 |
Returns whether the file is readable. | |
virtual bool | IsWritable () const =0 |
Returns whether the file is writable. | |
virtual String::EFormat | GetStringFormat () const =0 |
Returns the string encoding format to use when dealing with string functions. | |
virtual bool | IsEof () const =0 |
Returns whether end of file has been reached. | |
virtual int | GetC ()=0 |
Reads a character. | |
virtual bool | PutC (int nChar)=0 |
Writes a character. | |
virtual String | GetS ()=0 |
Reads a string. | |
virtual int | PutS (const String &sString)=0 |
Writes a string. | |
virtual uint32 | Read (void *pBuffer, uint32 nSize, uint32 nCount)=0 |
Reads the given number of bytes. | |
virtual uint32 | Write (const void *pBuffer, uint32 nSize, uint32 nCount)=0 |
Writes the given number of bytes. | |
virtual bool | Flush ()=0 |
Flushes the file buffer. | |
virtual bool | Seek (int32 nOffset, uint32 nLocation)=0 |
Sets the starting position. | |
virtual int32 | Tell () const =0 |
Gets the current position of the file pointer. | |
virtual uint32 | GetSize () const =0 |
Returns the file size. | |
virtual FileSearchImpl * | CreateSearch ()=0 |
Create a file searcher for the directory. | |
Protected Attributes | |
Url | m_cUrl |
const FileAccess * | m_pAccess |
Abstract base class for platform specific file object implementations.
PLCORE_API PLCore::FileImpl::FileImpl | ( | const Url & | cUrl, |
const FileAccess * | pAccess | ||
) | [protected] |
[in] | cUrl | URL of the file or directory |
[in] | pAccess | Additional file access information (can be a null pointer) |
virtual PLCORE_API PLCore::FileImpl::~FileImpl | ( | ) | [protected, virtual] |
Destructor.
virtual bool PLCore::FileImpl::Exists | ( | ) | const [protected, pure virtual] |
Check if the file or directory exists.
virtual bool PLCore::FileImpl::IsFile | ( | ) | const [protected, pure virtual] |
Check if the object is a regular file.
virtual bool PLCore::FileImpl::IsDirectory | ( | ) | const [protected, pure virtual] |
Check if the object is a directory.
virtual bool PLCore::FileImpl::CopyTo | ( | const String & | sDest, |
bool | bOverwrite | ||
) | const [protected, pure virtual] |
Copy the file or directory to a new location.
[in] | sDest | URL of the destination |
[in] | bOverwrite | Shall the file be overwritten if it already exists? |
virtual bool PLCore::FileImpl::MoveTo | ( | const String & | sDest | ) | [protected, pure virtual] |
Move the file or directory to a new location.
[in] | sDest | URL of the destination |
virtual bool PLCore::FileImpl::Rename | ( | const String & | sName | ) | [protected, pure virtual] |
Rename the file or directory.
[in] | sName | New filename (filename only, no path) |
virtual bool PLCore::FileImpl::CreateNewFile | ( | bool | bAlways | ) | [protected, pure virtual] |
Create a file.
[in] | bAlways | If 'true', the file is created (and therefore overwritten) if it already exists |
virtual bool PLCore::FileImpl::CreateNewDirectory | ( | ) | [protected, pure virtual] |
Create a directory.
virtual bool PLCore::FileImpl::Delete | ( | ) | [protected, pure virtual] |
Delete a file.
virtual bool PLCore::FileImpl::DeleteDirectory | ( | ) | [protected, pure virtual] |
Delete a directory.
virtual void PLCore::FileImpl::Close | ( | ) | [protected, pure virtual] |
Close the file or directory.
virtual bool PLCore::FileImpl::Open | ( | uint32 | nAccess, |
String::EFormat | nStringFormat = String::ASCII |
||
) | [protected, pure virtual] |
Open the file for reading and/or writing.
[in] | nAccess | Access mode (see EAccess) |
[in] | nStringFormat | String encoding format to use when dealing with string functions |
virtual bool PLCore::FileImpl::IsOpen | ( | ) | const [protected, pure virtual] |
Returns whether the file is open.
virtual bool PLCore::FileImpl::IsReadable | ( | ) | const [protected, pure virtual] |
Returns whether the file is readable.
virtual bool PLCore::FileImpl::IsWritable | ( | ) | const [protected, pure virtual] |
Returns whether the file is writable.
virtual String::EFormat PLCore::FileImpl::GetStringFormat | ( | ) | const [protected, pure virtual] |
Returns the string encoding format to use when dealing with string functions.
virtual bool PLCore::FileImpl::IsEof | ( | ) | const [protected, pure virtual] |
Returns whether end of file has been reached.
virtual int PLCore::FileImpl::GetC | ( | ) | [protected, pure virtual] |
Reads a character.
virtual bool PLCore::FileImpl::PutC | ( | int | nChar | ) | [protected, pure virtual] |
Writes a character.
[in] | nChar | Character to write |
virtual String PLCore::FileImpl::GetS | ( | ) | [protected, pure virtual] |
Reads a string.
virtual int PLCore::FileImpl::PutS | ( | const String & | sString | ) | [protected, pure virtual] |
Writes a string.
[in] | sString | String which should be written into the file |
virtual uint32 PLCore::FileImpl::Read | ( | void * | pBuffer, |
uint32 | nSize, | ||
uint32 | nCount | ||
) | [protected, pure virtual] |
Reads the given number of bytes.
[out] | pBuffer | Buffer were the data should be copied in (MUST valid and large enough!) |
[in] | nSize | Item size in bytes |
[in] | nCount | Maximum number of items to be read |
virtual uint32 PLCore::FileImpl::Write | ( | const void * | pBuffer, |
uint32 | nSize, | ||
uint32 | nCount | ||
) | [protected, pure virtual] |
Writes the given number of bytes.
[in] | pBuffer | Buffer with the data which should be written into the file (MUST valid and large enough!) |
[in] | nSize | Item size in bytes |
[in] | nCount | Maximum number of items to be written |
virtual bool PLCore::FileImpl::Flush | ( | ) | [protected, pure virtual] |
Flushes the file buffer.
virtual bool PLCore::FileImpl::Seek | ( | int32 | nOffset, |
uint32 | nLocation | ||
) | [protected, pure virtual] |
Sets the starting position.
[in] | nOffset | File offset in bytes relative to the given location |
[in] | nLocation | Location ("File::ESeek"-type) |
virtual int32 PLCore::FileImpl::Tell | ( | ) | const [protected, pure virtual] |
Gets the current position of the file pointer.
virtual uint32 PLCore::FileImpl::GetSize | ( | ) | const [protected, pure virtual] |
Returns the file size.
virtual FileSearchImpl* PLCore::FileImpl::CreateSearch | ( | ) | [protected, pure virtual] |
Create a file searcher for the directory.
Url PLCore::FileImpl::m_cUrl [protected] |
URL of the file or directory
const FileAccess* PLCore::FileImpl::m_pAccess [protected] |
File access information, can be a null pointer
|