|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CFileStream: public IStream { public: enum { modeCreate = 0x01, modeNoTruncate = 0x02, modeRead = 0x04, modeReadWrite = 0x08, modeWrite = 0x10, typeText = 0x20, typeBinary = 0x40 }; public: CFileStream(); ~CFileStream(); public: bool Open(const WCHAR *pszFileName, int nOpenFlags); void Close(); public: int Read(BYTE *pBuf, int nCount); void Write(const BYTE *pBuf, int nCount); void SetPosition(long lOff, int nFrom); long GetPosition(); }; typedef XInterface<CFileStream> XFileStream;
The file-based byte stream.
Constructor/Destructor Summary | |
CFileStream
();
����������Constructs the file stream. |
|
~CFileStream
();
����������Destroys the file stream. |
Function Summary | |
bool
|
Open
(const WCHAR *pszFileName, int nOpenFlags);
����������Opens a file, associates it with this stream. |
void
|
Close
();
����������Closes the file associated with this stream. |
int
|
Read
(BYTE *pBuf, int nCount);
����������Reads the specified number of bytes into the specified buffer from this stream. |
void
|
Write
(const BYTE *pBuf, int nCount);
����������Writes the specified number of bytes from the specified buffer to this stream. |
void
|
SetPosition
(long lOff, int nFrom);
����������Moves the file pointer to the specified position. |
long
|
GetPosition
();
����������Returns a current position of the file pointer. |
Constructor/Destructor Detail |
CFileStream();
Constructs the file stream.
~CFileStream();
Destroys the file stream.
Function Detail |
bool Open(const WCHAR *pszFileName, int nOpenFlags);
Opens a file, associates it with this stream.
The file name and the set of bit flags must be specified as arguments of this function.
Allowed values of bit flags are specified by the anonymous enumeration declared in this class.
pszFileName
- the file namenOpenFlags
- the set of flagstrue
if the file was successfully open;
false
otherwisevoid Close();
Closes the file associated with this stream.
int Read(BYTE *pBuf, int nCount);
Reads the specified number of bytes into the specified buffer from this stream.
The number of bytes actually read may be less than the number of bytes requested.
pBuf
- the buffer to hold resultnCount
- the number of bytes to readvoid Write(const BYTE *pBuf, int nCount);
Writes the specified number of bytes from the specified buffer to this stream.
pBuf
- the buffer to writenCount
- the number of bytes to writevoid SetPosition(long lOff, int nFrom);
Moves the file pointer to the specified position.
The file pointer is positioned relatively to the origin.
The origin is specified using the origin code; allowed values
are:
IStream::begin
for beginning of file,
IStream::current
for current position of the file pointer, and
IStream::end
for end of file.
lOff
- the relative positionnFrom
- the origin codelong GetPosition();
Returns a current position of the file pointer.
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |