source: icXML/icXML-devel/src/icxercesc/framework/XMLElementDecl.cpp @ 3157

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

Fixes for icXML 0.9

File size: 3.7 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: XMLElementDecl.cpp 679359 2008-07-24 11:15:19Z borisk $
20 */
21
22
23// ---------------------------------------------------------------------------
24//  Includes
25// ---------------------------------------------------------------------------
26#include <icxercesc/framework/XMLElementDecl.hpp>
27#include <xercesc/util/XMLUniDefs.hpp>
28#include <xercesc/util/XMLUni.hpp>
29#include <icxercesc/validators/schema/SchemaElementDecl.hpp>
30#include <icxercesc/validators/DTD/DTDElementDecl.hpp>
31#include <icxmlc/XMLConfig.hpp>
32
33XERCES_CPP_NAMESPACE_BEGIN
34
35// ---------------------------------------------------------------------------
36//  XMLElementDecl: Public, static data
37// ---------------------------------------------------------------------------
38const unsigned int  XMLElementDecl::fgInvalidElemId    = 0xFFFFFFFE;
39const unsigned int  XMLElementDecl::fgPCDataElemId     = 0xFFFFFFFF;
40const XMLCh         XMLElementDecl::fgPCDataElemName[] =
41{
42                chPound, chLatin_P, chLatin_C, chLatin_D, chLatin_A
43        ,   chLatin_T, chLatin_A, chNull
44};
45
46
47
48// ---------------------------------------------------------------------------
49//  XMLElementDecl: Destructor
50// ---------------------------------------------------------------------------
51XMLElementDecl::~XMLElementDecl()
52{
53    cleanUp();
54}
55
56// ---------------------------------------------------------------------------
57//  XMLElementDecl: Setter Methods
58// ---------------------------------------------------------------------------
59void
60XMLElementDecl::setElementName(const XMLCh* const prefix, const XMLCh* const localPart, const int uriId )
61{
62    cleanUp();
63        fElementName = new (fMemoryManager) QName(prefix, localPart, uriId, fMemoryManager);
64        fUriId = uriId;
65}
66
67void
68XMLElementDecl::setElementName(const XMLCh* const rawName, const int uriId)
69{
70    cleanUp();
71        fElementName = new (fMemoryManager) QName(rawName, uriId, fMemoryManager);
72        fUriId = uriId;
73}
74
75void XMLElementDecl::setElementName(const QName* const elementName)
76{
77    cleanUp();
78    fElementName = new QName(*elementName);
79        fUriId = elementName->getURI();
80}
81
82// ---------------------------------------------------------------------------
83//  ElementDecl: Hidden constructors
84// ---------------------------------------------------------------------------
85XMLElementDecl::XMLElementDecl(MemoryManager* const manager) :
86fMemoryManager(manager)
87, fElementName(0)
88, fCreateReason(XMLElementDecl::NoReason)
89, fId(XMLElementDecl::fgInvalidElemId)
90, fUriId(0)
91, fNamespaceContextId(0)
92, fExternalElement(false)
93{
94
95}
96
97/***
98 * Support for Serialization/De-serialization
99 ***/
100
101IMPL_XSERIALIZABLE_NOCREATE(XMLElementDecl)
102
103void XMLElementDecl::serialize(XSerializeEngine&)
104{
105    DEPRECATED_FEATURE_IN_ICXML;
106}
107
108void
109XMLElementDecl::storeElementDecl(XSerializeEngine&, XMLElementDecl* const)
110{
111    DEPRECATED_FEATURE_IN_ICXML;
112}
113
114XMLElementDecl* XMLElementDecl::loadElementDecl(XSerializeEngine&)
115{
116    DEPRECATED_FEATURE_IN_ICXML;
117}
118
119XERCES_CPP_NAMESPACE_END
Note: See TracBrowser for help on using the repository browser.