GME  13
DOMLSInputImpl.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: DOMLSInputImpl.cpp 752848 2009-03-12 12:44:40Z amassari $
00020  */
00021 
00022 #include "DOMLSInputImpl.hpp"
00023 
00024 #include <xercesc/util/XMLString.hpp>
00025 
00026 XERCES_CPP_NAMESPACE_BEGIN
00027 
00028 DOMLSInputImpl::DOMLSInputImpl(MemoryManager* const manager /*= XMLPlatformUtils::fgMemoryManager*/)
00029 :fStringData(0)
00030 ,fByteStream(0)
00031 ,fEncoding(0)
00032 ,fPublicId(0)
00033 ,fSystemId(0)
00034 ,fBaseURI(0)
00035 ,fIssueFatalErrorIfNotFound(true)
00036 ,fMemoryManager(manager)
00037 {
00038 }
00039 
00040 DOMLSInputImpl::~DOMLSInputImpl()
00041 {
00042     fMemoryManager->deallocate(fEncoding);
00043     fMemoryManager->deallocate(fPublicId);
00044     fMemoryManager->deallocate(fSystemId);
00045     fMemoryManager->deallocate(fBaseURI);
00046 }
00047 
00048 void DOMLSInputImpl::setStringData(const XMLCh* data)
00049 {
00050     fStringData=data;
00051     setEncoding(XMLUni::fgXMLChEncodingString);
00052 }
00053 
00054 void DOMLSInputImpl::setByteStream(InputSource* stream)
00055 {
00056     fByteStream=stream;
00057 }
00058 
00059 void DOMLSInputImpl::setEncoding(const XMLCh* const encodingStr)
00060 {
00061     fMemoryManager->deallocate(fEncoding);
00062     fEncoding = XMLString::replicate(encodingStr, fMemoryManager);
00063 }
00064 
00065 void DOMLSInputImpl::setPublicId(const XMLCh* const publicId)
00066 {
00067     fMemoryManager->deallocate(fPublicId);
00068     fPublicId = XMLString::replicate(publicId, fMemoryManager);
00069 }
00070 
00071 void DOMLSInputImpl::setSystemId(const XMLCh* const systemId)
00072 {
00073     fMemoryManager->deallocate(fSystemId);
00074     fSystemId = XMLString::replicate(systemId, fMemoryManager);
00075 }
00076 
00077 void DOMLSInputImpl::setBaseURI(const XMLCh* const baseURI)
00078 {
00079     fMemoryManager->deallocate(fBaseURI);
00080     fBaseURI = XMLString::replicate(baseURI, fMemoryManager);
00081 }
00082 
00083 void DOMLSInputImpl::setIssueFatalErrorIfNotFound(bool flag)
00084 {
00085     fIssueFatalErrorIfNotFound=flag;
00086 }
00087 
00088 void DOMLSInputImpl::release()
00089 {
00090     delete this;
00091 }
00092 
00093 
00094 XERCES_CPP_NAMESPACE_END
00095