3 #include "ACEXML/common/InputSource.h"
4 #include "ACEXML/common/StreamFactory.h"
7 ACEXML_InputSource::ACEXML_InputSource ()
15 ACEXML_InputSource::ACEXML_InputSource (ACEXML_CharStream
*stm
)
17 encoding_ (ACE::strnew (stm
->getEncoding())),
19 systemId_ (stm
->getSystemId() ? ACE::strnew (stm
->getSystemId()): 0)
24 * Create a new input source with a character stream.
28 ACEXML_InputSource::ACEXML_InputSource (const ACEXML_Char
*systemId
)
32 systemId_ (ACE::strnew (systemId
))
34 ACEXML_StreamFactory factory
;
35 ACEXML_CharStream
* stm
= factory
.create_stream (this->systemId_
);
38 this->setCharStream (stm
);
39 this->setEncoding (this->charStream_
->getEncoding());
43 ACEXML_InputSource::~ACEXML_InputSource ()
45 delete[] this->publicId_
;
47 delete[] this->systemId_
;
49 delete this->charStream_
;
50 this->charStream_
= 0;
51 delete[] this->encoding_
;
56 ACEXML_InputSource::getCharStream () const
58 return this->charStream_
;
62 ACEXML_InputSource::getEncoding () const
64 return this->encoding_
;
68 ACEXML_InputSource::getPublicId () const
70 return this->publicId_
;
74 ACEXML_InputSource::getSystemId () const
76 return this->systemId_
;
80 ACEXML_InputSource::setCharStream (ACEXML_CharStream
*stm
)
82 delete this->charStream_
;
83 this->charStream_
= stm
;
87 ACEXML_InputSource::setEncoding (const ACEXML_Char
*encoding
)
89 delete[] this->encoding_
;
90 this->encoding_
= ACE::strnew (encoding
);
94 ACEXML_InputSource::setPublicId (const ACEXML_Char
*publicId
)
96 delete[] this->publicId_
;
97 this->publicId_
= ACE::strnew (publicId
);
101 ACEXML_InputSource::setSystemId (const ACEXML_Char
*systemId
)
103 delete[] this->systemId_
;
104 this->systemId_
= ACE::strnew (systemId
);