source: NonGTP/Xerces/xerces-c_2_8_0/include/xercesc/validators/datatype/NameDatatypeValidator.hpp @ 2674

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