GME  13
Wrapper4InputSource.cpp
Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  * 
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  * 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 /*
00019  * $Id: Wrapper4InputSource.cpp 471747 2006-11-06 14:31:56Z amassari $
00020  */
00021 
00022 
00023 // ---------------------------------------------------------------------------
00024 //  Includes
00025 // ---------------------------------------------------------------------------
00026 #include <xercesc/framework/Wrapper4InputSource.hpp>
00027 #include <xercesc/sax/InputSource.hpp>
00028 #include <xercesc/util/NullPointerException.hpp>
00029 
00030 XERCES_CPP_NAMESPACE_BEGIN
00031 
00032 // ---------------------------------------------------------------------------
00033 //  Wrapper4InputSource: Constructor and Destructor
00034 // ---------------------------------------------------------------------------
00035 Wrapper4InputSource::Wrapper4InputSource(InputSource* const inputSource,
00036                                          const bool adoptFlag
00037                                          , MemoryManager* const manager) :
00038     fAdoptInputSource(adoptFlag)
00039     ,  fInputSource(inputSource)
00040 {
00041     if (!inputSource)
00042         ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, manager);
00043 }
00044 
00045 Wrapper4InputSource::~Wrapper4InputSource()
00046 {
00047     if (fAdoptInputSource)
00048         delete fInputSource;
00049 }
00050 
00051 
00052 // ---------------------------------------------------------------------------
00053 //  Wrapper4InputSource: Getter methods
00054 // ---------------------------------------------------------------------------
00055 bool Wrapper4InputSource::getIssueFatalErrorIfNotFound() const
00056 {
00057     return fInputSource->getIssueFatalErrorIfNotFound();
00058 }
00059 
00060 const XMLCh* Wrapper4InputSource::getEncoding() const
00061 {
00062     return fInputSource->getEncoding();
00063 }
00064 
00065 const XMLCh* Wrapper4InputSource::getSystemId() const
00066 {
00067     return fInputSource->getSystemId();
00068 }
00069 
00070 const XMLCh* Wrapper4InputSource::getPublicId() const
00071 {
00072     return fInputSource->getPublicId();
00073 }
00074 
00075 
00076 // ---------------------------------------------------------------------------
00077 //  Wrapper4InputSource: Setter methods
00078 // ---------------------------------------------------------------------------
00079 void Wrapper4InputSource::setIssueFatalErrorIfNotFound(bool flag)
00080 {
00081     fInputSource->setIssueFatalErrorIfNotFound(flag);
00082 }
00083 
00084 
00085 void Wrapper4InputSource::setEncoding(const XMLCh* const encodingStr)
00086 {
00087     fInputSource->setEncoding(encodingStr);
00088 }
00089 
00090 
00091 void Wrapper4InputSource::setPublicId(const XMLCh* const publicId)
00092 {
00093     fInputSource->setPublicId(publicId);
00094 }
00095 
00096 
00097 void Wrapper4InputSource::setSystemId(const XMLCh* const systemId)
00098 {
00099     fInputSource->setSystemId(systemId);
00100 }
00101 
00102 
00103 // ---------------------------------------------------------------------------
00104 //  Wrapper4InputSource: Stream methods
00105 // ---------------------------------------------------------------------------
00106 InputSource* Wrapper4InputSource::getByteStream() const
00107 {
00108     return fInputSource;
00109 }
00110 
00111 // ---------------------------------------------------------------------------
00112 //  Wrapper4InputSource: Memory methods
00113 // ---------------------------------------------------------------------------
00114 void Wrapper4InputSource::release()
00115 {
00116     Wrapper4InputSource* src = (Wrapper4InputSource*) this;
00117     delete src;
00118 }
00119 
00120 XERCES_CPP_NAMESPACE_END
00121