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: AnySimpleTypeDatatypeValidator.cpp 637054 2008-03-14 11:08:37Z amassari $
20  */
21 
22 
23 // ---------------------------------------------------------------------------
24 //  Includes
25 // ---------------------------------------------------------------------------
26 #include <xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp>
27 #include <xercesc/util/RuntimeException.hpp>
28 
29 XERCES_CPP_NAMESPACE_BEGIN
30 
31 // ---------------------------------------------------------------------------
32 //  AnySimpleTypeDatatypeValidator: Constructors and Destructor
33 // ---------------------------------------------------------------------------
AnySimpleTypeDatatypeValidator(MemoryManager * const manager)34 AnySimpleTypeDatatypeValidator::AnySimpleTypeDatatypeValidator(MemoryManager* const manager)
35     : DatatypeValidator(0, 0, SchemaSymbols::XSD_RESTRICTION, DatatypeValidator::AnySimpleType, manager)
36 {
37     setWhiteSpace(DatatypeValidator::PRESERVE);
38     setFinite(true);
39 }
40 
~AnySimpleTypeDatatypeValidator()41 AnySimpleTypeDatatypeValidator::~AnySimpleTypeDatatypeValidator()
42 {
43 
44 }
45 
46 // ---------------------------------------------------------------------------
47 //  DatatypeValidators: Compare methods
48 // ---------------------------------------------------------------------------
compare(const XMLCh * const lValue,const XMLCh * const rValue,MemoryManager * const)49 int AnySimpleTypeDatatypeValidator::compare(  const XMLCh* const lValue
50                                             , const XMLCh* const rValue
51                                             , MemoryManager* const)
52 {
53     return XMLString::compareString(lValue, rValue);
54 }
55 
56 // ---------------------------------------------------------------------------
57 //  AnySimpleTypeDatatypeValidator: Instance methods
58 // ---------------------------------------------------------------------------
newInstance(RefHashTableOf<KVStringPair> * const facets,RefArrayVectorOf<XMLCh> * const enums,const int,MemoryManager * const manager)59 DatatypeValidator* AnySimpleTypeDatatypeValidator::newInstance
60 (
61       RefHashTableOf<KVStringPair>* const facets
62     , RefArrayVectorOf<XMLCh>* const      enums
63     , const int
64     , MemoryManager* const                manager
65 )
66 {
67     // We own them, so we will delete them first
68     delete facets;
69     delete enums;
70 
71     ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::DV_InvalidOperation, manager);
72 
73     // to satisfy some compilers
74     return 0;
75 }
76 
getEnumString() const77 const RefArrayVectorOf<XMLCh>* AnySimpleTypeDatatypeValidator::getEnumString() const
78 {
79 	return 0;
80 }
81 
82 /***
83  * Support for Serialization/De-serialization
84  ***/
85 
IMPL_XSERIALIZABLE_TOCREATE(AnySimpleTypeDatatypeValidator)86 IMPL_XSERIALIZABLE_TOCREATE(AnySimpleTypeDatatypeValidator)
87 
88 void AnySimpleTypeDatatypeValidator::serialize(XSerializeEngine& serEng)
89 {
90     DatatypeValidator::serialize(serEng);
91 }
92 
93 XERCES_CPP_NAMESPACE_END
94 
95 /**
96   * End of file AnySimpleTypeDatatypeValidator.cpp
97   */
98 
99