source: icXML/icXML-devel/src/xercesc/framework/Wrapper4InputSource.cpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 3.8 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: Wrapper4InputSource.cpp 471747 2006-11-06 14:31:56Z amassari $
20 */
21
22
23// ---------------------------------------------------------------------------
24//  Includes
25// ---------------------------------------------------------------------------
26#include <xercesc/framework/Wrapper4InputSource.hpp>
27#include <xercesc/sax/InputSource.hpp>
28#include <xercesc/util/NullPointerException.hpp>
29
30XERCES_CPP_NAMESPACE_BEGIN
31
32// ---------------------------------------------------------------------------
33//  Wrapper4InputSource: Constructor and Destructor
34// ---------------------------------------------------------------------------
35Wrapper4InputSource::Wrapper4InputSource(InputSource* const inputSource,
36                                         const bool adoptFlag
37                                         , MemoryManager* const manager) :
38    fAdoptInputSource(adoptFlag)
39    ,  fInputSource(inputSource)
40{
41    if (!inputSource)
42        ThrowXMLwithMemMgr(NullPointerException, XMLExcepts::CPtr_PointerIsZero, manager);
43}
44
45Wrapper4InputSource::~Wrapper4InputSource()
46{
47    if (fAdoptInputSource)
48        delete fInputSource;
49}
50
51
52// ---------------------------------------------------------------------------
53//  Wrapper4InputSource: Getter methods
54// ---------------------------------------------------------------------------
55bool Wrapper4InputSource::getIssueFatalErrorIfNotFound() const
56{
57    return fInputSource->getIssueFatalErrorIfNotFound();
58}
59
60const XMLCh* Wrapper4InputSource::getEncoding() const
61{
62    return fInputSource->getEncoding();
63}
64
65const XMLCh* Wrapper4InputSource::getSystemId() const
66{
67    return fInputSource->getSystemId();
68}
69
70const XMLCh* Wrapper4InputSource::getPublicId() const
71{
72    return fInputSource->getPublicId();
73}
74
75
76// ---------------------------------------------------------------------------
77//  Wrapper4InputSource: Setter methods
78// ---------------------------------------------------------------------------
79void Wrapper4InputSource::setIssueFatalErrorIfNotFound(bool flag)
80{
81    fInputSource->setIssueFatalErrorIfNotFound(flag);
82}
83
84
85void Wrapper4InputSource::setEncoding(const XMLCh* const encodingStr)
86{
87    fInputSource->setEncoding(encodingStr);
88}
89
90
91void Wrapper4InputSource::setPublicId(const XMLCh* const publicId)
92{
93    fInputSource->setPublicId(publicId);
94}
95
96
97void Wrapper4InputSource::setSystemId(const XMLCh* const systemId)
98{
99    fInputSource->setSystemId(systemId);
100}
101
102
103// ---------------------------------------------------------------------------
104//  Wrapper4InputSource: Stream methods
105// ---------------------------------------------------------------------------
106InputSource* Wrapper4InputSource::getByteStream() const
107{
108    return fInputSource;
109}
110
111// ---------------------------------------------------------------------------
112//  Wrapper4InputSource: Memory methods
113// ---------------------------------------------------------------------------
114void Wrapper4InputSource::release()
115{
116    Wrapper4InputSource* src = (Wrapper4InputSource*) this;
117    delete src;
118}
119
120XERCES_CPP_NAMESPACE_END
121
Note: See TracBrowser for help on using the repository browser.