Inheritance diagram for CP_File:
Public Member Functions | |
void | Create (FourCharCode inCreator, FourCharCode inType=kCP_Text_FileType) |
void | Create (FourCharCode inCreator, FourCharCode inType=kCP_Text_FileType) |
void | Open (SInt16 inPermissions=CP_E_FilePerm_ReadWrite) |
void | Open (SInt32 inPermissions=CP_E_FilePerm_ReadWrite, bool inOpenResourceFork=true) |
void | Close () |
void | Close () |
SInt64 | Length () |
SInt64 | Length () |
SInt64 | GetPosition () const |
SInt64 | GetPosition () const |
SInt64 | SetPosition (UInt16 inMode, SInt64 inOffset) |
SInt64 | SetPosition (UInt16 inMode, SInt64 inOffset) |
UInt32 | ReadData (void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
UInt32 | ReadData (void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
UInt32 | WriteData (const void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
UInt32 | WriteData (const void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
bool | IsOpen () |
bool | IsOpen () |
SInt16 | OpenFork (SInt32 inPermissions, const HFSUniStr255 &inForkName) |
CP_FileSystemSpec | GetFileSpec () |
CP_FileSystemSpec | GetFileSpec () |
OSFileRef | GetRefNumber () |
void | SetEOF (SInt32 inEOF) |
void | UseResFile () |
void | FlushFork (SInt16 inRefNum) |
Constructor / Destructor | |
CP_File () | |
Constructor. | |
CP_File (const CP_FileSystemSpec &inFileSpec) | |
virtual | ~CP_File () |
Destructor. | |
Creation | |
void | Create (FourCharCode inCreator, FourCharCode inType=kCP_Text_FileType) |
Open / Close | |
void | Open (SInt32 inPermissions=CP_E_FilePerm_ReadWrite) |
void | Close () |
Length | |
SInt64 | Length () |
Position | |
SInt64 | GetPosition () const |
SInt64 | SetPosition (UInt16 inMode, SInt64 inOffset) |
void | SetEOF (SInt32 inEOF) |
Read / Write | |
UInt32 | ReadData (void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
UInt32 | WriteData (const void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
Testers | |
bool | IsOpen () |
Setters | |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
Setters | |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
Setters | |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
Creation | |
void | Create (FourCharCode inCreator, FourCharCode inType=kCP_Text_FileType) |
Open / Close | |
void | Open (SInt32 inPermissions=CP_E_FilePerm_ReadWrite) |
void | Close () |
Length | |
SInt64 | Length () |
Position | |
SInt64 | GetPosition () const |
SInt64 | SetPosition (UInt16 inMode, SInt64 inOffset) |
void | SetEOF (SInt32 inEOF) |
Read / Write | |
UInt32 | ReadData (void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
UInt32 | WriteData (const void *inDataBuffer, UInt32 inDataSize, UInt16 inPositionMode=CP_E_FileSeek_FromCurrent, SInt64 inOffset=0) |
Setters | |
void | SetFileSpec (const CP_FileSystemSpec &inFileSpec) |
Testers | |
bool | IsOpen () |
Protected Member Functions | |
const HFSUniStr255 & | GetDataForkName () |
const HFSUniStr255 & | GetResourceForkName () |
Protected Attributes | |
CP_FileSystemSpec | fFileSpec |
OSFileRef | fRefNum |
OSFileRef | fDataForkRefNum |
OSFileRef | fResourceForkRefNum |
The name and location of this file object is defined by its CP_FileSystemSpec.
|
Constructor. You will need to call SetFileSpec on this object before you can work with this file object, as this default constructor does not represent a valid file system object.
|
|
Constructor. Constructs the file from the passed in CP_FileSystemSpec.
|
|
Destructor.
|
|
Creates the platforms file object in the platforms file system. Throws an OSError if there is a problem creating the file.
|
|
|
|
|
|
Opens the file for reading and/or writing depending on the passed in inPermissions. Throws an OSError if there is a problem opening the data fork. Throws a std::logic_error if the file is already open.
|
|
Opens the file for reading and/or writing depending on the passed in inPermissions. Throws an OSError if there is a problem opening the data fork. Throws a std::logic_error if the file is already open. Note: If the file is being opened for write access, and the file doesn't currently exist, it will be created, and then opened to match the behavior of Windows.
|
|
Opens the file for reading and/or writing depending on the passed in inPermissions. Throws an OSError if there is a problem opening the data fork. Throws a std::logic_error if the file is already open.
|
|
Closes the file in the platforms file system.
|
|
|
|
|
|
Returns the length of our file. The file needs to currently be open, otherwide an error occurs.
|
|
|
|
|
|
Returns the current file marker position in the file.
|
|
|
|
|
|
Sets the current position in the file based on the passed in parameters.
|
|
|
|
|
|
Reads data fromm the file. Throws an OSError if there was a problem.
|
|
|
|
|
|
Writes data to the file. Throws an OSError if there was a problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the MacOS name of the data fork. Throws an OSError if there is a problem getting the forks name.
|
|
Returns the MacOS name of the resource fork. Throws an OSError if there is a problem getting the forks name.
|
|
|
|
CP_FileSystemSpec containing the name and location of this file. |
|
CP_FileSystemSpec containing the name and location of this file. |
|
MacOS file reference number for file when open, Data fork. |