source: icXML/icXML-devel/src/icxercesc/framework/XMLAttr.cpp

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

Changes to icxercesc files

File size: 4.3 KB
RevLine 
[2720]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: XMLAttr.cpp 901107 2010-01-20 08:45:02Z borisk $
20 */
21
22
23// ---------------------------------------------------------------------------
24//  Includes
25// ---------------------------------------------------------------------------
[2721]26#include <icxercesc/framework/XMLAttr.hpp>
[2720]27#include <xercesc/framework/MemoryManager.hpp>
28#include <xercesc/util/OutOfMemoryException.hpp>
[2774]29#include <icxmlc/XMLStringU.hpp>
30#include <icxmlc/XMLNamespaceResolver.hpp>
31#include <icxmlc/XMLConfig.hpp>
[2720]32
33XERCES_CPP_NAMESPACE_BEGIN
34
35// ---------------------------------------------------------------------------
36//  XMLAttr: Constructors and Destructor
37// ---------------------------------------------------------------------------
[3564]38XMLAttr::XMLAttr(MemoryManager* const /* manager */)
39: fSpecified(false)
40, fType(XMLAttDef::CData)
41, fValueLen(0)
42, fValue(0)
43, fAttName(0)
[2720]44{
45
46}
47
[3564]48XMLAttr::XMLAttr
49(
50    const QName               *         qName
51    , const XMLCh               * const attrValue
52    , const XMLAttDef::AttTypes         type
53    , const bool                        specified
54    , MemoryManager             * const /* manager */
55    , DatatypeValidator         *       datatypeValidator
56    , const bool                        isSchema
57)
58: fSpecified(specified)
59, fType(type)
60, fValueLen(0)
61, fValue(0)
62, fAttName(const_cast<QName*>(qName))
[2720]63{
64        setValue(attrValue);
65}
66
[3564]67XMLAttr::XMLAttr
68(
69    const QName               *         qName
70    , const XMLCh               * const attrValue
71    , const XMLSize_t                   attrLength
72    , const XMLAttDef::AttTypes         type
73    , const bool                        specified
74    , MemoryManager             * const /* manager */
75    , DatatypeValidator         *       datatypeValidator
76    , const bool                        isSchema
77)
78: fSpecified(specified)
79, fType(type)
80, fValueLen(0)
81, fValue(0)
82, fAttName(const_cast<QName*>(qName))
[2720]83{
84    setValue(attrValue, attrLength);
85}
86
87// ---------------------------------------------------------------------------
88//  XMLAttr: Getter methods
89// ---------------------------------------------------------------------------
90const XMLCh* XMLAttr::getQName() const
91{
92        return fAttName->getRawName();
93}
94
[2774]95bool XMLAttr::isXMLNS() const
96{
[3103]97    return (getURIId() == XMLNamespaceResolver::fXMLNSUriId);
[2774]98}
[2720]99
100// ---------------------------------------------------------------------------
101//  XMLAttr: Setter methods
102// ---------------------------------------------------------------------------
103void XMLAttr::setURIId(const unsigned int uriId)
104{
105        fAttName->setURI(uriId);
106}
107
108void XMLAttr::setValue(const XMLCh * const newValue)
109{
110        fValue = newValue;
111        fValueLen = XMLString::stringLen(newValue);
112}
113
114void XMLAttr::setValue(const XMLCh * const newValue, const XMLSize_t length)
115{
116        fValue = newValue;
117        fValueLen = length;
118}
119
[2774]120
[2720]121// ---------------------------------------------------------------------------
122//  XMLAttr: Private, helper methods
123// ---------------------------------------------------------------------------
124void XMLAttr::cleanUp()
125{
126
127}
128
[3564]129void XMLAttr::setName(const unsigned int, const XMLCh* const, const XMLCh* const)
130{
131    DEPRECATED_FEATURE_IN_ICXML;
132}
133
134XMLAttr::XMLAttr(const unsigned int, const XMLCh* const, const XMLCh* const, const XMLCh* const, const XMLAttDef::AttTypes, const bool, MemoryManager* const, DatatypeValidator*, const bool)
135{
136    DEPRECATED_FEATURE_IN_ICXML;
137}
138
139XMLAttr::XMLAttr(const unsigned int, const XMLCh* const, const XMLCh* const, const XMLAttDef::AttTypes, const bool, MemoryManager* const, DatatypeValidator *, const bool )
140{
141    DEPRECATED_FEATURE_IN_ICXML;
142}
143
144
[2720]145XERCES_CPP_NAMESPACE_END
Note: See TracBrowser for help on using the repository browser.