source: icXML/icXML-devel/src/xercesc/sax/SAXParseException.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: 4.3 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: SAXParseException.cpp 672273 2008-06-27 13:57:00Z borisk $
20 */
21
22
23// ---------------------------------------------------------------------------
24//  Includes
25// ---------------------------------------------------------------------------
26#include    <xercesc/util/XMLString.hpp>
27#include    <xercesc/sax/Locator.hpp>
28#include    <xercesc/sax/SAXParseException.hpp>
29
30XERCES_CPP_NAMESPACE_BEGIN
31
32// ---------------------------------------------------------------------------
33//  SAXParseException: Constructors and Destructor
34// ---------------------------------------------------------------------------
35SAXParseException::SAXParseException(const  XMLCh* const    message
36                                    , const Locator&        locator
37                                    , MemoryManager* const  manager) :
38    SAXException(message, manager)
39    , fColumnNumber(locator.getColumnNumber())
40    , fLineNumber(locator.getLineNumber())
41    , fPublicId(XMLString::replicate(locator.getPublicId(), manager))
42    , fSystemId(XMLString::replicate(locator.getSystemId(), manager))
43{
44}
45
46SAXParseException::SAXParseException(const  XMLCh* const    message
47                                    , const XMLCh* const    publicId
48                                    , const XMLCh* const    systemId
49                                    , const XMLFileLoc   lineNumber
50                                    , const XMLFileLoc   columnNumber
51                                    , MemoryManager* const  manager) :
52    SAXException(message, manager)
53    , fColumnNumber(columnNumber)
54    , fLineNumber(lineNumber)
55    , fPublicId(XMLString::replicate(publicId, manager))
56    , fSystemId(XMLString::replicate(systemId, manager))
57{
58}
59
60SAXParseException::SAXParseException(const SAXParseException& toCopy) :
61
62    SAXException(toCopy)
63    , fColumnNumber(toCopy.fColumnNumber)
64    , fLineNumber(toCopy.fLineNumber)
65    , fPublicId(0)
66    , fSystemId(0)
67{
68    fPublicId = XMLString::replicate(toCopy.fPublicId, toCopy.fMemoryManager);
69    fSystemId = XMLString::replicate(toCopy.fSystemId, toCopy.fMemoryManager);
70}
71
72SAXParseException::~SAXParseException()
73{
74    fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId);
75    fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId);
76}
77
78
79// ---------------------------------------------------------------------------
80//  SAXParseException: Public operators
81// ---------------------------------------------------------------------------
82SAXParseException&
83SAXParseException::operator=(const SAXParseException& toAssign)
84{
85    if (this == &toAssign)
86        return *this;
87
88    fMemoryManager->deallocate(fPublicId);//XMLString::release(&fPublicId);
89    fMemoryManager->deallocate(fSystemId);//XMLString::release(&fSystemId);
90
91    this->SAXException::operator =(toAssign);
92    fColumnNumber = toAssign.fColumnNumber;
93    fLineNumber = toAssign.fLineNumber;
94
95    fPublicId = XMLString::replicate(toAssign.fPublicId, fMemoryManager);
96    fSystemId = XMLString::replicate(toAssign.fSystemId, fMemoryManager);
97
98    return *this;
99}
100
101
102// ---------------------------------------------------------------------------
103//  SAXParseException: Getter methods
104// ---------------------------------------------------------------------------
105const XMLCh* SAXParseException::getPublicId() const
106{
107    return fPublicId;
108}
109
110const XMLCh* SAXParseException::getSystemId() const
111{
112    return fSystemId;
113}
114
115XMLFileLoc SAXParseException::getLineNumber() const
116{
117    return fLineNumber;
118}
119
120XMLFileLoc SAXParseException::getColumnNumber() const
121{
122    return fColumnNumber;
123}
124
125XERCES_CPP_NAMESPACE_END
Note: See TracBrowser for help on using the repository browser.