#include <file.h>
Inheritance diagram for BufferFile:
Public Member Functions | |
BufferFile (unsigned char *pucBuffer=0, int iSize=0, const std::string &rstrPath="", const std::string &rstrFilename="", std::ios_base::openmode uiOpenMode=(std::ios_base::in|std::ios_base::binary), bool bOpen=false, Directory *pkDirectory=0) | |
virtual | ~BufferFile () |
virtual void | Close () |
void | SetBuffer (unsigned char *pucBuffer, int iSize) |
virtual bool | Open (const std::string &rstrPath="", const std::string &rstrFilename="", std::ios_base::openmode uiOpenMode=(std::ios_base::openmode) 0) |
virtual bool | IsValid () const |
void | SetByteOrder (Core::BYTEORDER eByteOrder) |
virtual int | GetSize () |
std::streampos | Tellg () const |
std::streampos | Tellp () const |
virtual File & | Read (void *pBuffer, int iNumBytes) |
virtual File & | Write (const void *pBuffer, int iNumBytes) |
virtual File & | GetLine (char *pcDest, unsigned int uiCount, char cDelimiter= '\n') |
File & | Seekg (std::streamoff uiOffset, std::ios_base::seekdir uiDirection) |
File & | Seekp (std::streamoff uiOffset, std::ios_base::seekdir uiDirection) |
const std::string & | GetPath () const |
const std::string & | GetName () const |
Directory * | GetDirectory () |
virtual Core::BYTEORDER | GetByteOrder () const |
bool | DetermineByteOrder (int iReferenceValue) |
bool | SetBinary (bool bBinary) |
bool | IsBinary () const |
bool | DetermineBinaryMode (const unsigned char *pucReferenceValues) |
File & | operator<< (bool bData) |
File & | operator<< (int8_t cData) |
File & | operator<< (uint8_t ucData) |
File & | operator<< (int16_t sData) |
File & | operator<< (uint16_t usData) |
File & | operator<< (int32_t iData) |
File & | operator<< (uint32_t uiData) |
File & | operator<< (float fData) |
File & | operator<< (const char *pszData) |
File & | operator<< (const std::string &rstrData) |
File & | operator<< (const HashString &rstrData) |
File & | operator<< (std::ios_base &(NE_CDECL *pfnManip)(std::ios_base &)) |
File & | operator<< (std::basic_ostream< char > &(NE_CDECL *pfnManip)(std::basic_ostream< char > &)) |
File & | operator>> (bool &rbData) |
File & | operator>> (int8_t &rcData) |
File & | operator>> (uint8_t &rucData) |
File & | operator>> (int16_t &rsData) |
File & | operator>> (uint16_t &rusData) |
File & | operator>> (int32_t &riData) |
File & | operator>> (uint32_t &ruiData) |
File & | operator>> (float &rfData) |
File & | operator>> (std::string &rstrData) |
File & | operator>> (HashString &rstrData) |
File & | operator>> (std::ios_base &(NE_CDECL *pfnManip)(std::ios_base &)) |
File & | operator>> (std::basic_ostream< char > &(NE_CDECL *pfnManip)(std::basic_ostream< char > &)) |
bool | operator! () const |
Static Public Member Functions | |
std::string | ExtractBaseFileName (const std::string &rstrPath) |
std::string | ExtractFileExtension (const std::string &rstrPath) |
std::string | ExtractFileName (const std::string &rstrPath) |
std::string | ExtractPathName (const std::string &rstrPath) |
Protected Member Functions | |
virtual void | AllocStream (const std::string &rstrFullPath) |
Protected Attributes | |
BufferFileStreamBuf * | m_pkBuffer |
std::iostream * | m_pkStream |
std::ios_base::openmode | m_uiOpenMode |
bool | m_bBinary |
Core::BYTEORDER | m_eByteOrder |
Directory * | m_pkDirectory |
|
|
|
|
|
Allocate the stream object
Reimplemented from File. Reimplemented in VirtualFile. |
|
Deallocate buffer Reimplemented from File. |
|
Set buffer to use
|
|
Open file. Close any open handles. If null are passed as args, previously stored names will be used
|
|
Query if file is valid (file exists and is open)
|
|
Set byte order of file
|
|
Get file size. File does not have to be open. Returns -1 if error (unable to open file)
|
|
Get current get (read) pointer position
|
|
Get current put (write) pointer position
|
|
Read raw data
|
|
Write raw data
|
|
Get up to uiCount characters, discarding delimiter
|
|
Reposition the get (read) pointer
|
|
Reposition the put (write) pointer
|
|
|
|
|
|
|
|
|
|
Try to determine file byte ordering by reading integer and comparing with reference Integer will be read from file at current position, and compared to reference value. If determination was successful, the file byte ordering will be set. File pointer will be restored to original position in any case.
|
|
Set binary/ascii mode flag
|
|
Query if binary/ascii mode
|
|
Try to determine file mode by reading four binary values and comparing with reference array. If matching the file mode will be set to binary, if not matching file mode will be set to ascii
|
|
Write boolean to file
|
|
Write char to file
|
|
Write byte to file
|
|
Write short to file
|
|
Write unsigned short to file
|
|
Write integer to file
|
|
Write unsigned integer to file
|
|
Write float to file
|
|
Write null-terminated string to file
|
|
Write string to file
|
|
Write string to file
|
|
Insert stream manipulator
|
|
Insert stream manipulator
|
|
Read boolean from file
|
|
Read char from file
|
|
Read byte from file
|
|
Read short from file
|
|
Read unsigned short from file
|
|
Read integer from file
|
|
Read unsigned integer from file
|
|
Read float from file
|
|
Read string from file
|
|
Read string from file
|
|
Insert stream manipulator
|
|
Insert stream manipulator
|
|
Test for valid/invalid state and EOF
|
|
Get base file name (no path and no extension) from full path name
|
|
Get file extension (no path and no name) from full path name
|
|
Get file name (no path but with extension) from full path name
|
|
Get path name from full path name including file name
|
|
Ptr to stream buffer |
|
Stream |
|
Open mode |
|
Binary mode |
|
Byte order |
|
Directory we are attached to (if any) |