source: icXML/icXML-devel/src/icxercesc/validators/DTD/DTDAttDef.cpp @ 2720

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

Initial check-in of icXML 0.8 source files

File size: 3.1 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: DTDAttDef.cpp 679359 2008-07-24 11:15:19Z borisk $
20 */
21
22
23// ---------------------------------------------------------------------------
24//  Includes
25// ---------------------------------------------------------------------------
26#include <xercesc/framework/XMLElementDecl.hpp>
27#include <xercesc/validators/DTD/DTDAttDef.hpp>
28#include <icxmlc/XMLNamespaceResolver.hpp>
29
30XERCES_CPP_NAMESPACE_BEGIN
31
32// ---------------------------------------------------------------------------
33//  DTDAttDef: Constructors and Destructor
34// ---------------------------------------------------------------------------
35DTDAttDef::DTDAttDef(MemoryManager* const manager) :
36
37        XMLAttDef(XMLAttDef::CData, XMLAttDef::Implied, manager)
38   , fElemId(XMLElementDecl::fgInvalidElemId)
39        , fAttName(0)
40{
41}
42
43DTDAttDef::DTDAttDef(const  XMLCh* const           attName
44                                        , const XMLAttDef::AttTypes    type
45                                        , const XMLAttDef::DefAttTypes defType
46                                        , MemoryManager* const         manager) :
47        XMLAttDef(type, defType, manager)
48        , fElemId(XMLElementDecl::fgInvalidElemId)
49        , fAttName(0)
50{
51        fAttName = new (manager) QName(attName, XMLNamespaceResolver::fEmptyUriId, manager);
52}
53
54DTDAttDef::DTDAttDef( const   XMLCh* const         attName
55                                        , const XMLCh* const           attValue
56                                        , const XMLAttDef::AttTypes    type
57                                        , const XMLAttDef::DefAttTypes defType
58                                        , const XMLCh* const           enumValues
59                                        , MemoryManager* const         manager) :
60
61        XMLAttDef(attValue, type, defType, enumValues, manager)
62        , fElemId(XMLElementDecl::fgInvalidElemId)
63        , fAttName(0)
64{
65        fAttName = new (manager) QName(attName, XMLNamespaceResolver::fEmptyUriId, manager);
66}
67
68DTDAttDef::~DTDAttDef()
69{
70        delete fAttName;
71}
72
73
74// ---------------------------------------------------------------------------
75//  DTDAttDef: Setter methods
76// ---------------------------------------------------------------------------
77void DTDAttDef::setName(const XMLCh* const newName)
78{
79        DEPRECATED_FEATURE_IN_ICXML;
80}
81
82/***
83 * Support for Serialization/De-serialization
84 ***/
85
86IMPL_XSERIALIZABLE_TOCREATE(DTDAttDef)
87
88void DTDAttDef::serialize(XSerializeEngine& serEng)
89{
90        XMLAttDef::serialize(serEng);
91
92        if (serEng.isStoring())
93        {
94                serEng.writeSize (fElemId);
95                serEng.writeString(fName);
96        }
97        else
98        {
99                serEng.readSize (fElemId);
100                serEng.readString(fName);
101        }
102}
103
104
105XERCES_CPP_NAMESPACE_END
Note: See TracBrowser for help on using the repository browser.