|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CInputSource: public CInterface { public: CInputSource(); CInputSource(IStream *pByteStream); CInputSource(IUnicodeStream *pCharacterStream); CInputSource(const CString &strSystemId); ~CInputSource(); public: void SetByteStream(IStream *pByteStream); IStream *GetByteStream() const; void SetCharacterStream(IUnicodeStream *pCharacterStream); IUnicodeStream *GetCharacterStream() const; void SetPublicId(const CString &strPublicId); CString GetPublicId() const; void SetSystemId(const CString &strSystemId); CString GetSystemId() const; void SetEncoding(const CString &strEncoding); CString GetEncoding() const; };
The input source for XML entities.
This class allows an SXP application to encapsulate information about an input source in a single object, which may include a public identifier, a system identifier, a byte stream (possibly with a specified encoding) and/or a character stream.
The SXP parser will use the input source to determine how to read XML input. If there is a character stream available, the parser will read the stream directly; if not, the parser will use a byte stream, if available; if neither a character stream nor a byte stream is available, the parser will attempt to open a URI connection to the resource identified by the system identifier.
Constructor/Destructor Summary | |
CInputSource
();
����������Constructs the input source. |
|
CInputSource
(IStream *pByteStream);
����������Constructs the input source with a byte stream. |
|
CInputSource
(IUnicodeStream *pCharacterStream);
����������Constructs the input source with a character stream. |
|
CInputSource
(const CString &strSystemId);
����������Constructs the input source with a system identifier. |
|
~CInputSource
();
����������Destroys the input source. |
Function Summary | |
void
|
SetByteStream
(IStream *pByteStream);
����������Sets the byte stream for this input source. |
IStream�*
|
GetByteStream
();
����������Gets the byte stream for this input source. |
void
|
SetCharacterStream
(IUnicodeStream *pCharacterStream);
����������Sets the character stream for this input source. |
IUnicodeStream�*
|
GetCharacterStream
() const;
����������Gets the character stream for this input source |
void
|
SetPublicId
(const CString &strPublicId);
����������Sets the public identifier for this input source. |
CString
|
GetPublicId
();
����������Gets the public identifier for this input source. |
void
|
SetSystemId
(const CString &strSystemId);
����������Sets the system identifier for this input source. |
CString
|
GetSystemId
();
����������Gets the system identifier for this input source. |
void
|
SetEncoding
(const CString &strEncoding);
����������Sets the character encoding, if known. |
CString
|
GetEncoding
();
����������Gets the character encoding for a byte stream or URI. |
Constructor/Destructor Detail |
CInputSource();
Constructs the input source.
CInputSource(IStream *pByteStream);
Constructs the input source with a byte stream.
pByteStream
- the raw byte stream
containing the document or other entityCInputSource(IUnicodeStream *pCharacterStream);
Constructs the input source with a character stream.
pCharacterStream
- the character stream
containing the document or other entityCInputSource(const CString &strSystemId);
Constructs the input source with a system identifier.
strSystemId
- the system identifier~CInputSource();
Destroys the input source.
Function Detail |
void SetByteStream(IStream *pByteStream);
Sets the byte stream for this input source.
The SXP parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself.
If the application knows the character encoding
of the byte stream, it should set it with the
SetEncoding
method.
pByteStream
- the raw byte stream
containing the document or other entityIStream *GetByteStream();
Gets the byte stream for this input source.
NULL
if none was suppliedvoid SetCharacterStream(IUnicodeStream *pCharacterStream);
Sets the character stream for this input source.
If there is a character stream specified, the parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier.
pCharacterStream
- the character stream
containing the document or other entityIUnicodeStream *GetCharacterStream() const;
Gets the character stream for this input source
NULL
if non was suppliedvoid SetPublicId(const CString &strPublicId);
Sets the public identifier for this input source.
The public identifier is always optional: if the application writer includes one, it will be provided as part of the location information.
strPublicId
- the public identifierCString GetPublicId();
Gets the public identifier for this input source.
void SetSystemId(const CString &strSystemId);
Sets the system identifier for this input source.
The system identifier is optional if there is a byte stream or a character stream, but it is still useful to provide one, since the application can use it to resolve relative URI and can include it in error messages and warnings. The parser will attempt to open a connection to the URI only if there is no byte stream or character stream specified.
If the application knows the character encoding of the object
pointed to by the system identifier, it can register the encoding
using the
SetEncoding
method.
strSystemId
- the system identifierCString GetSystemId();
Gets the system identifier for this input source.
void SetEncoding(const CString &strEncoding);
Sets the character encoding, if known.
The encoding must be a string acceptable for an XML encoding declaration.
This method has no effect when the application provides a character stream.
strEncoding
- a string describing the character encodingCString GetEncoding();
Gets the character encoding for a byte stream or URI.
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |