source: icXML/icXML-devel/src/xercesc/validators/datatype/ENTITYDatatypeValidator.hpp @ 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.6 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: ENTITYDatatypeValidator.hpp 527149 2007-04-10 14:56:39Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_ENTITY_DATATYPEVALIDATOR_HPP)
23#define XERCESC_INCLUDE_GUARD_ENTITY_DATATYPEVALIDATOR_HPP
24
25#include <xercesc/validators/datatype/StringDatatypeValidator.hpp>
26#include <xercesc/util/NameIdPool.hpp>
27#include <xercesc/validators/DTD/DTDEntityDecl.hpp>
28
29XERCES_CPP_NAMESPACE_BEGIN
30
31class VALIDATORS_EXPORT ENTITYDatatypeValidator : public StringDatatypeValidator
32{
33public:
34
35    // -----------------------------------------------------------------------
36    //  Public ctor/dtor
37    // -----------------------------------------------------------------------
38        /** @name Constructors and Destructor. */
39    //@{
40
41    ENTITYDatatypeValidator
42    (
43        MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
44    );
45    ENTITYDatatypeValidator
46    (
47        DatatypeValidator* const baseValidator
48        , RefHashTableOf<KVStringPair>* const facets
49        , RefArrayVectorOf<XMLCh>* const enums
50        , const int finalSet
51        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
52    );
53
54    virtual ~ENTITYDatatypeValidator();
55
56        //@}
57
58    // -----------------------------------------------------------------------
59    // Validation methods
60    // -----------------------------------------------------------------------
61    /** @name Validation Function */
62    //@{
63
64    /**
65     * validate that a string matches the boolean datatype
66     * @param content A string containing the content to be validated
67     *
68     * @exception throws InvalidDatatypeException if the content is
69     * is not valid.
70     */
71
72        virtual void validate
73                 (
74                  const XMLCh*             const content
75                ,       ValidationContext* const context = 0
76                ,       MemoryManager*     const manager = XMLPlatformUtils::fgMemoryManager
77                  );
78
79    //@}
80
81    // -----------------------------------------------------------------------
82    // Compare methods
83    // -----------------------------------------------------------------------
84    /** @name Compare Function */
85    //@{
86
87    /**
88     * Compare two boolean data types
89     *
90     * @param content1
91     * @param content2
92     * @return
93     */
94    virtual int compare(const XMLCh* const, const XMLCh* const
95        ,       MemoryManager*     const manager = XMLPlatformUtils::fgMemoryManager);
96
97    //@}
98
99    /**
100      * Returns an instance of the base datatype validator class
101          * Used by the DatatypeValidatorFactory.
102      */
103    virtual DatatypeValidator* newInstance
104    (
105        RefHashTableOf<KVStringPair>* const facets
106        , RefArrayVectorOf<XMLCh>* const enums
107        , const int finalSet
108        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
109    );
110
111    /***
112     * Support for Serialization/De-serialization
113     ***/
114    DECL_XSERIALIZABLE(ENTITYDatatypeValidator)
115
116protected:
117
118    //
119    // ctor provided to be used by derived classes
120    //
121    ENTITYDatatypeValidator(DatatypeValidator*            const baseValidator
122                          , RefHashTableOf<KVStringPair>* const facets
123                          , const int                           finalSet
124                          , const ValidatorType                 type);
125
126    virtual void checkValueSpace(const XMLCh* const content
127                                , MemoryManager* const manager);
128
129private:
130    // -----------------------------------------------------------------------
131    // Unimplemented constructors and operators
132    // -----------------------------------------------------------------------
133    ENTITYDatatypeValidator(const ENTITYDatatypeValidator&);
134    ENTITYDatatypeValidator& operator = (const  ENTITYDatatypeValidator&);
135
136};
137
138XERCES_CPP_NAMESPACE_END
139
140#endif
141
142/**
143  * End of file ENTITYDatatypeValidator.hpp
144  */
Note: See TracBrowser for help on using the repository browser.