Unicorn XML Toolkit
Version 1.50.00

Namespace Core
Class CStringUnicodeStream

class CStringUnicodeStream: public IUnicodeStream {
public:
    CStringUnicodeStream(const WCHAR *pszSource);
    ~CStringUnicodeStream();
public:
    int Read(WCHAR *pBuf, int nCount);
    void Write(const WCHAR *pBuf, int nCount);
    void SetPosition(long lOff, int nFrom);
    long GetPosition();
    };

The string-based Unicode character stream.

This stream obtains its data from the specified character string. It is read-only; write operation is not supported.

Since:
1.00.00
Version:
1.50.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
CStringUnicodeStream (const WCHAR *pszSource);
����������Constructs the string-based stream.
~CStringUnicodeStream ();
����������Destroys the string-based stream.

Function Summary
int Read (WCHAR *pBuf, int nCount);
����������Reads the specified number of characters into the specified buffer from this stream.
void Write (const WCHAR *pBuf, int nCount);
����������Writes the specified number of characters from the specified buffer to this stream.
void SetPosition (long lOff, int nFrom);
����������Moves the stream I/O pointer to the specified position.
long GetPosition ();
����������Returns a current position of the stream I/O pointer.

Constructor/Destructor Detail

CStringUnicodeStream

CStringUnicodeStream(const WCHAR *pszSource);

Constructs the string-based stream.

Parameters:
pszSource - the string containing the stream source data

~CStringUnicodeStream

~CStringUnicodeStream();

Destroys the string-based stream.

Function Detail

Read

int Read(WCHAR *pBuf, int nCount);

Reads the specified number of characters into the specified buffer from this stream.

The number of characters actually read may be less than the number of characters requested.

Parameters:
pBuf - the buffer to hold result
nCount - the number of characters to read
Returns:
the number of characters actually read; the negative integer if read error occured

Write

void Write(const WCHAR *pBuf, int nCount);

Writes the specified number of characters from the specified buffer to this stream.

This function is not supported by this stream class.

Parameters:
pBuf - the buffer to write
nCount - the number of characters to write

SetPosition

void SetPosition(long lOff, int nFrom);

Moves the stream I/O pointer to the specified position.

The stream I/O pointer is positioned relatively to the origin. The origin is specified using the origin code; allowed values are: IUnicodeStream::begin for beginning of the stream, IUnicodeStream::current for current position of the stream I/O pointer, and IUnicodeStream::end for end of the stream.

Parameters:
lOff - the relative position
nFrom - the origin code

GetPosition

long GetPosition();

Returns a current position of the stream I/O pointer.

Returns:
the current position of the stream I/O pointer

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.