PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBFile
Wrapper Class for the IFile interface.
#include <SFBFile.h.hpp>
class SFBFile : public SFBAStream;
SFMTYPEDEFWRAPPER(SFBFile)

Inheritance diagram

 Inheritance diagram of SFBFileClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IFile

Member

Public Functions
Void Cancel( PFNNOTIFY notify = null , VoidPtr data = null )
Cancel the callback registered with SFBFile::Readable().
SFCError GetInfo( AEEFileInfoPtr info )
Get the file creation date, file size, filename, and file attributes.
SFCError GetInfoEx( AEEFileInfoExPtr infoEx )
Get the extended information of the file identified.
SFCError Seek( AEEFileSeekType seekType , SInt32 moveDistance )
Move the file pointer.
SInt32 SetCacheSize( SInt32 size )
Set the size for file-caching operations.
SFCError Truncate( UInt32 position )
Truncate the file.
UInt32 Write( VoidConstPtr buffer , UInt32 count )
Write the specified number of bytes to an open file.
UInt32 Write( SFXBufferConstRef buffer )
Write the specified number of bytes to an open file.
SInt32 Read( VoidPtr buffer , UInt32 count ) (inherits from SFBAStream)
Attempt to read data from a stream, and returns the number of bytes read. If no data is available for reading, it returns the value AEE_STREAM_WOULDBLOCK.
SInt32 Read( SFXBufferPtr buffer ) (inherits from SFBAStream)
Attempt to read data from a stream, and returns the number of bytes read. If no data is available for reading, it returns the value AEE_STREAM_WOULDBLOCK.
Void Readable( PFNNOTIFY notify , VoidPtr data = null ) (inherits from SFBAStream)
Register a callback that checks whether data is available to be read. It is called when the SFBAStream::Read() returns AEE_STREAM_WOULDBLOCK.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBFile::Cancel
Cancel the callback registered with SFBFile::Readable().
[ public ]
Void Cancel(
    PFNNOTIFY notify = null   // address of the callback function
    VoidPtr data = null       // user defiend data that will be passed to the callback function when it is invoked
);

Reference

BREW API IFILE_Cancel | PFNNOTIFY | SFBAStream::Readable


SFBFile::GetInfo
Get the file creation date, file size, filename, and file attributes.
[ public ]
SFCError GetInfo(
    AEEFileInfoPtr info   // placeholder for file information
);

Reference

BREW API IFILE_GetInfo


SFBFile::GetInfoEx
Get the extended information of the file identified.
[ public ]
SFCError GetInfoEx(
    AEEFileInfoExPtr infoEx   // placeholder for extended file information
);

Reference

BREW API IFILE_GetInfoEx | AEEFileInfoEx | SFBFileMgr::GetInfo


SFBFile::Seek
Move the file pointer.
[ public ]
SFCError Seek(
    AEEFileSeekType seekType   // pointer to IFile Interface object.
                               // seekType : [_SEEK_CURRENT | _SEEK_START | _SEEK_END]
    SInt32 moveDistance        // distance to move
);

Reference

BREW API IFILE_Seek


SFBFile::SetCacheSize
Set the size for file-caching operations.
[ public ]
SInt32 SetCacheSize(
    SInt32 size   
);

Argument

size

Size of cache. SCS_DEFAULT - Use default file cache size specified by OEM SCS_MIN - Minimum cache size set by OEM SCS_MAX - Maximum cache size set by OEM SCS_BEST - Use file size if between min and max specified by OEM

Reference

BREW API IFILE_SetCacheSize


SFBFile::Truncate
Truncate the file.
[ public ]
SFCError Truncate(
    UInt32 position   // truncate position
);

Reference

BREW API IFILE_Truncate


SFBFile::Write
Write the specified number of bytes to an open file.
[ public ]
UInt32 Write(
    VoidConstPtr buffer   // buffer from which the data is written
    UInt32 count          // number of bytes to be written
);
[ public ]
UInt32 Write(
    SFXBufferConstRef buffer   // buffer from which the data is written
);

Reference

BREW API IFILE_Write | SFBFileMgr::OpenFile | SFBAStream::Read