SophiaFramework UNIVERSE 5.3 |
BREW 2.0 | BREW 2.1 | BREW 3.1 | BREW 4.0 |
---|---|---|---|
X | X | X | O |
Public Functions | |
---|---|
SFCError |
Creat(
ACharConstPtr path
) This function is the same as SFBFilePort::OpenEx() with nFlags equal to FS_O_WRONLY|FS_O_CREAT|FS_O_TRUNC.
|
SFCError |
Creat(
SFXAnsiStringConstRef path
) This function is the same as SFBFilePort::OpenEx() with nFlags equal to FS_O_WRONLY|FS_O_CREAT|FS_O_TRUNC.
|
SFCError |
GetLastError( Void ) Returns the specific BREW-defined error code from the last SFBFilePort::Read(), SFBFilePort::Write(), or SFBFilePort::Seek() operation that returned IPORT_ERROR.
|
SFCError |
Lock(
UInt32 lock
) Applies or removes a lock on the file opened with associated SFBFilePort instance.
|
static SFBFilePortSmp |
NewInstance(
SFCErrorPtr exception = null
) Create a new SFBFilePort instance.
|
static SFBFilePortSmp |
NewInstance(
AEECLSID id
, SFCErrorPtr exception = null
) Create a new SFBFilePort instance.
|
SFCError |
OpenEx(
ACharConstPtr path
, SInt32 flags
) Opens an existing file, optionally after creating a new file.
|
SFCError |
OpenEx(
SFXAnsiStringConstRef path
, SInt32 flags
) Opens an existing file, optionally after creating a new file.
|
SFCError |
Read(
VoidPtr buffer
, SInt32 size
) Reads bytes from a file currently open for reading.
|
SFCError |
Read(
SFXBufferPtr buffer
) Reads bytes from a file currently open for reading.
|
SFCError |
Rewind( Void ) This function is the same as SFBFilePort::Seek() with nOffset equal to zero and nWhence equal to FS_SEEK_SET.
|
SFCError |
Seek(
SInt32 offset
, SInt32 whence
) Reposition the file point in an open file.
|
SFCError |
Stat(
FSStat * buffer
, SInt32 size
) Obtains information about an open file.
|
SFCError |
StatVFS(
FSStatVFS * buffer
, SInt32 size
) Obtains information about the virtual file system containing an open file.
|
SFCError |
Truncate(
SInt32 length
) Truncate a file to the specified length.
|
SFCError |
Close( Void )
(inherits from SFBPort)
Close an opened port or stops a open in progress.
|
static Bool |
Exhausted(
SInt32 code
)
(inherits from SFBSource)
Determine if a SFBSource, a SFBPeek, or a SFBGetLine is out of data.
|
SFCError |
IOCtl(
SInt32 option
, UInt32 val
)
(inherits from SFBPort)
Allow some control over the behaviour of an SFBPort.
|
SFCError |
Open(
ACharConstPtr port
)
(inherits from SFBPort)
Open the specified prt.
|
SFCError |
Open(
SFXAnsiStringConstRef port
)
(inherits from SFBPort)
Open the specified prt.
|
SFCError |
QueryInterface(
AEECLSID clsid
, VoidHandle handle
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
SFCError |
QueryInterface(
AEECLSID clsid
, SFBBaseSmpPtr handle
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
SFBBaseSmp |
QueryInterface(
AEECLSID clsid
)
(inherits from SFBQuery)
Ask an object for another API contract from the object in question.
|
Void |
Readable(
SFXCallbackPtr callback
)
(inherits from SFBSource)
Schedule a callback to be called when SFBSource::Read() is able to return something other than ISOURCE_WAIT.
|
Void |
Self(
AEECLSID clsidReq
, SFBQuerySmpPtr clone
, AEECLSID clsidImp
)
(inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
|
SFBQuerySmp |
Self(
AEECLSID clsidReq
, AEECLSID clsidImp
)
(inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
|
SInt32 |
Write(
ACharConstPtr port
, SInt32 bufSize
)
(inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
|
SInt32 |
Write(
SFXAnsiStringConstRef buf
)
(inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
|
SInt32 |
Write(
SFXBufferConstRef buf
)
(inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
|
Void |
Writeable(
SFXCallbackPtr callback
)
(inherits from SFBPort)
Schedule a function to be called when SFBPort::Write() would return something other than AEEPORT_WAIT.
|
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.
|
[ public ] SFCError Creat( ACharConstPtr path // the path to the file of interest );
[ public ] SFCError Creat( SFXAnsiStringConstRef path // the path to the file of interest );
[ public ] SFCError GetLastError(Void);
A specific BREW-defined error code.
Returns AEE_SUCCESS if the lock/unlock operations is successful otherwise; a BREW-defined error code is returned.
A file has to be opened by SFBFilePort before it can be locked/unlocked. By default all locks are advisory and exclusive.
Advisory lock implies that file system will not restrict any operation on a file which has been locked i.e a locked file can be accessed without using advisory locks. Advisory locks allow cooperating processes to perform consistent operations on files.
Exclusive lock implies that once a file has been locked, any request for locking the same file from any process will fail till the file has been unlocked again.
[ public, static ] SFBFilePortSmp NewInstance( SFCErrorPtr exception = null // Error );
[ public, static ] SFBFilePortSmp NewInstance( AEECLSID id // Class ID SFCErrorPtr exception = null // Error );
[ public ] SFCError OpenEx( ACharConstPtr path // the path to the file of interest SInt32 flags // bitwise or of one or more FS_O_* flags );
[ public ] SFCError OpenEx( SFXAnsiStringConstRef path // the path to the file of interest SInt32 flags // bitwise or of one or more FS_O_* flags );
the path to the file of interest
The nFlags parameter is specified by exactly one of the following:
bit-wise-or'd with zero or more of the following:
Often, more than one flag will be specified, for example:
Not all combinations of flags are valid, for example:
Returns AEE_SUCCESS if the operation was successful. Otherwise returns a valid BREW-defined error code.
See SFBFileSystem::Access() for a description of the privileges required to read and/or write paths.
[ public ] SFCError Read( VoidPtr buffer // where the bytes read should end up SInt32 size // how many bytes to attempt to read );
[ public ] SFCError Read( SFXBufferPtr buffer // where the bytes read should end up );
Returns the number of bytes read for a successful operation. Note that this may be less than the number of bytes requested.
A zero return value indicates end of file (EOF). Returns IPORT_ERROR otherwise;
the specific BREW-defined error code may be obtained via SFBFilePort::GetLastError().
The bytes will be read at the current file point. The resulting file point will be advanced by the number of bytes read.
[ public ] SFCError Rewind(Void);
[ public ] SFCError Seek( SInt32 offset // offset from whence; may be negative SInt32 whence // starting point for nOffset (FS_SEEK_*) );
Returns the new file point for a successful operation. Returns IPORT_ERROR otherwise; the specific BREW-defined error code may be obtained via SFBFilePort::GetLastError().
The offset may be negative. The starting point may be one of the following:
The combination of offset and starting point may not result in a point that is before the beginning of the file.
The new point may be after the end of the file. However, seeking past the end does not grow the file; new bytes must be written to grow the file. Any resulting hole in the file will be read as a sequence of zero valued bytes.
[ public ] SFCError Stat( FSStat * buffer // pointer to a struct FSStat, which is to be filled in SInt32 size // the size of buffer );
Common error codes: AEE_EBADSTATE: SFBFilePort is not open
[ public ] SFCError StatVFS( FSStatVFS * buffer // pointer to a struct FSStatVFS, which is to be filled in SInt32 size // the size of buffer );
Returns AEE_SUCCESS if the operation was successful. Otherwise returns a valid BREW-defined error code.
Common error codes: AEE_EBADSTATE: SFBFilePort is not open
Returns AEE_SUCCESS if the operation was successful. Otherwise returns a valid BREW-defined error code.
If the size of the file previously exceeded length, the extra data shall no longer be available to reads on the file.
If the file previously was smaller than this size, the extended area shall appear as if it were zero-filled. The value of the seek pointer shall not be modified.
Common error codes:
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |