#include <ACEXML/common/InputSource.h>
Collaboration diagram for ACEXML_InputSource:
Public Member Functions | |
ACEXML_InputSource (void) | |
ACEXML_InputSource (ACEXML_CharStream *stream) | |
ACEXML_InputSource (const ACEXML_Char *systemId) | |
virtual | ~ACEXML_InputSource (void) |
virtual ACEXML_CharStream * | getCharStream (void) const |
virtual const ACEXML_Char * | getEncoding (void) const |
virtual const ACEXML_Char * | getPublicId (void) const |
virtual const ACEXML_Char * | getSystemId (void) const |
virtual void | setCharStream (ACEXML_CharStream *charStream) |
virtual void | setEncoding (const ACEXML_Char *encoding) |
virtual void | setPublicId (const ACEXML_Char *publicId) |
virtual void | setSystemId (const ACEXML_Char *systemId) |
Private Attributes | |
ACEXML_CharStream * | charStream_ |
ACEXML_Char * | encoding_ |
ACEXML_Char * | publicId_ |
ACEXML_Char * | systemId_ |
This class allows a SAX 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.
There are two places that the application will deliver this input source to the parser: as the argument to the Parser.parse method, or as the return value of the EntityResolver.resolveEntity method.
The SAX parser will use the InputSource object to determine how to read XML input. If there is a character stream available, the parser will read that 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.
An InputSource object belongs to the application: the SAX parser shall never modify it in any way (it may modify a copy if necessary).
Definition at line 53 of file InputSource.h.
|
Default constructor. Definition at line 8 of file InputSource.cpp.
00009 : charStream_ (0), 00010 encoding_ (0), 00011 publicId_ (0), 00012 systemId_ (0) 00013 { 00014 } |
|
Create a new input source with a ACEXML_Char stream. Notice that ACEXML_InputSource assumes the ownership of Definition at line 16 of file InputSource.cpp.
00017 : charStream_ (stm), 00018 encoding_ (ACE::strnew (stm->getEncoding())), 00019 publicId_ (0), 00020 systemId_ (stm->getSystemId() ? ACE::strnew (stm->getSystemId()): 0) 00021 { 00022 } |
|
Create a new input source with a system identifier. Definition at line 29 of file InputSource.cpp. References ACEXML_Char, ACEXML_StreamFactory::create_stream(), setCharStream(), and setEncoding().
00030 : charStream_ (0), 00031 encoding_ (0), 00032 publicId_ (0), 00033 systemId_ (ACE::strnew (systemId)) 00034 { 00035 ACEXML_StreamFactory factory; 00036 ACEXML_CharStream* stm = factory.create_stream (this->systemId_); 00037 if (stm) 00038 { 00039 this->setCharStream (stm); 00040 this->setEncoding (this->charStream_->getEncoding()); 00041 } 00042 } |
|
Default destructor. Definition at line 44 of file InputSource.cpp. References charStream_, publicId_, and systemId_.
00045 { 00046 delete[] this->publicId_; 00047 this->publicId_ = 0; 00048 delete[] this->systemId_; 00049 this->systemId_ = 0; 00050 delete this->charStream_; 00051 this->charStream_ = 0; 00052 delete[] this->encoding_; 00053 this->encoding_ = 0; 00054 } |
|
Get the ACEXML_Char stream for this input source. Definition at line 57 of file InputSource.cpp. References charStream_. Referenced by ACEXML_Parser::get(), and ACEXML_Parser::peek().
00058 { 00059 return this->charStream_; 00060 } |
|
Get the character encoding for a byte stream or URI. Definition at line 63 of file InputSource.cpp.
00064 { 00065 return this->encoding_; 00066 } |
|
Get the public identifier for this input source. Definition at line 69 of file InputSource.cpp. References publicId_.
00070 { 00071 return this->publicId_; 00072 } |
|
Get the system identifier for this input source. Definition at line 75 of file InputSource.cpp. References systemId_. Referenced by ACEXML_Parser::initialize(), and ACEXML_Parser::switch_input().
00076 { 00077 return this->systemId_; 00078 } |
|
Set the ACEXML_Char stream for this input source. Notice that ACEXML_InputSource assumes the ownership of Definition at line 81 of file InputSource.cpp. References charStream_. Referenced by ACEXML_InputSource().
00082 { 00083 delete this->charStream_; 00084 this->charStream_ = stm; 00085 } |
|
Set the character encoding, if known. Definition at line 88 of file InputSource.cpp. References ACEXML_Char, and ACE::strnew(). Referenced by ACEXML_InputSource().
00089 { 00090 delete[] this->encoding_; 00091 this->encoding_ = ACE::strnew (encoding); 00092 } |
|
Set the public identifier for this input source. Definition at line 95 of file InputSource.cpp. References ACEXML_Char, publicId_, and ACE::strnew().
00096 { 00097 delete[] this->publicId_; 00098 this->publicId_ = ACE::strnew (publicId); 00099 } |
|
Set the public identifier for this input source. Definition at line 102 of file InputSource.cpp. References ACEXML_Char, ACE::strnew(), and systemId_.
00103 { 00104 delete[] this->systemId_; 00105 this->systemId_ = ACE::strnew (systemId); 00106 } |
|
Definition at line 122 of file InputSource.h. Referenced by getCharStream(), setCharStream(), and ~ACEXML_InputSource(). |
|
Definition at line 123 of file InputSource.h. |
|
Definition at line 124 of file InputSource.h. Referenced by getPublicId(), setPublicId(), and ~ACEXML_InputSource(). |
|
Definition at line 125 of file InputSource.h. Referenced by getSystemId(), setSystemId(), and ~ACEXML_InputSource(). |