ScummVM API documentation
Bagel::CBofFile Class Reference
Inheritance diagram for Bagel::CBofFile:
Bagel::CBofObject Bagel::CBofError Bagel::CBofDataFile Bagel::CBofStringTable Bagel::CBagSaveGameFile

Public Member Functions

 CBofFile ()
 
 CBofFile (const char *pszFileName, uint32 lFlags=(0x00000002|0x00000004))
 
virtual ~CBofFile ()
 
ErrorCode open (const char *pszFileName, uint32 lFlags=(0x00000002|0x00000004))
 
ErrorCode create (const char *pszFileName, uint32 lFlags=(0x00000002|0x00000004)|0x00000020)
 
virtual ErrorCode close ()
 
virtual ErrorCode read (void *pDestBuf, int32 lBytes)
 
virtual ErrorCode write (const void *pSrcBuf, int32 lBytes)
 
void commit ()
 
ErrorCode seek (uint32 lPos)
 
ErrorCode seekToBeginning ()
 
ErrorCode seekToEnd ()
 
ErrorCode setPosition (uint32 lPos)
 
uint32 getPosition ()
 
uint32 getLength ()
 
 operator Common::SeekableReadStream * () const
 
- Public Member Functions inherited from Bagel::CBofError
void reportError (ErrorCode errCode, const char *format,...)
 
bool errorOccurred () const
 
ErrorCode getErrorCode () const
 
void clearError ()
 

Protected Attributes

char _szFileName [MAX_FNAME]
 
Common::Stream_stream = nullptr
 
uint32 _lFlags = ( 0x00000002 | 0x00000004 )
 
- Protected Attributes inherited from Bagel::CBofError
ErrorCode _errCode
 

Additional Inherited Members

- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 
- Static Public Member Functions inherited from Bagel::CBofError
static void fatalError (ErrorCode errCode, const char *format,...)
 
static void initialize ()
 
static int getErrorCount ()
 
- Protected Member Functions inherited from Bagel::CBofError
virtual void bofMessageBox (const Common::String &content, const Common::String &title)
 
- Static Protected Attributes inherited from Bagel::CBofError
static int _count
 

Constructor & Destructor Documentation

◆ CBofFile() [1/2]

Bagel::CBofFile::CBofFile ( )

Default constructor

◆ CBofFile() [2/2]

Bagel::CBofFile::CBofFile ( const char *  pszFileName,
uint32  lFlags = (0x00000002|0x00000004) 
)

Open a specified file for access

Parameters
pszFileNameFilename
lFlagsAccess flags

◆ ~CBofFile()

virtual Bagel::CBofFile::~CBofFile ( )
virtual

Destructor

Member Function Documentation

◆ open()

ErrorCode Bagel::CBofFile::open ( const char *  pszFileName,
uint32  lFlags = (0x00000002|0x00000004) 
)

Open specified file into this object

Parameters
pszFileNameFilename
lFlagsAccess flags

◆ create()

ErrorCode Bagel::CBofFile::create ( const char *  pszFileName,
uint32  lFlags = (0x00000002|0x00000004)|0x00000020 
)

Creates specified file

Parameters
pszFileNameFilename
lFlagsAccess flags

◆ close()

virtual ErrorCode Bagel::CBofFile::close ( )
virtual

Close a currently open file

Reimplemented in Bagel::CBofDataFile.

◆ read()

virtual ErrorCode Bagel::CBofFile::read ( void *  pDestBuf,
int32  lBytes 
)
virtual

Read from a currently open file

Parameters
pDestBufDestination buffer
lBytesNumber of bytes
Returns
Error code

Reimplemented in Bagel::CBofDataFile.

◆ write()

virtual ErrorCode Bagel::CBofFile::write ( const void *  pSrcBuf,
int32  lBytes 
)
virtual

Write to a currently open file

Parameters
pSrcBufSource buffer
lBytesNumber of bytes
Returns
Error code

Reimplemented in Bagel::CBofDataFile.

◆ commit()

void Bagel::CBofFile::commit ( )

Flushes I/O stream

◆ seek()

ErrorCode Bagel::CBofFile::seek ( uint32  lPos)
inline

Seek to a specified location in the file

Returns
Error code

◆ seekToBeginning()

ErrorCode Bagel::CBofFile::seekToBeginning ( )
inline

Sets the file pointer to the beginning of the file

Returns
Error code

◆ seekToEnd()

ErrorCode Bagel::CBofFile::seekToEnd ( )

Sets the file pointer to the end of the file

Returns
Error code

◆ setPosition()

ErrorCode Bagel::CBofFile::setPosition ( uint32  lPos)

Sets the current file-seek position to that specified

Parameters
lPosNew position

◆ getPosition()

uint32 Bagel::CBofFile::getPosition ( )

Retrieves the current seek position

◆ getLength()

uint32 Bagel::CBofFile::getLength ( )

Get the length of a file


The documentation for this class was generated from the following file: