NCNameDatatypeValidator.hpp
上传用户:zhuqijet
上传日期:2013-06-25
资源大小:10074k
文件大小:7k
源码类别:

词法分析

开发平台:

Visual C++

  1. /*
  2.  * The Apache Software License, Version 1.1
  3.  *
  4.  * Copyright (c) 2001 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  *
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  *
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  *
  26.  * 4. The names "Xerces" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written
  29.  *    permission, please contact apache@apache.org.
  30.  *
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation, and was
  51.  * originally based on software copyright (c) 1999, International
  52.  * Business Machines, Inc., http://www.ibm.com .  For more information
  53.  * on the Apache Software Foundation, please see
  54.  * <http://www.apache.org/>.
  55.  */
  56. /*
  57.  * $Id: NCNameDatatypeValidator.hpp,v 1.4 2003/05/15 18:53:26 knoaman Exp $
  58.  * $Log: NCNameDatatypeValidator.hpp,v $
  59.  * Revision 1.4  2003/05/15 18:53:26  knoaman
  60.  * Partial implementation of the configurable memory manager.
  61.  *
  62.  * Revision 1.3  2002/12/18 14:17:55  gareth
  63.  * Fix to bug #13438. When you eant a vector that calls delete[] on its members you should use RefArrayVectorOf.
  64.  *
  65.  * Revision 1.2  2002/11/04 14:53:28  tng
  66.  * C++ Namespace Support.
  67.  *
  68.  * Revision 1.1.1.1  2002/02/01 22:22:42  peiyongz
  69.  * sane_include
  70.  *
  71.  * Revision 1.3  2001/10/09 20:49:09  peiyongz
  72.  * init(): take 1 arg
  73.  *
  74.  * Revision 1.2  2001/09/27 13:51:25  peiyongz
  75.  * DTV Reorganization: ctor/init created to be used by derived class
  76.  *
  77.  * Revision 1.1  2001/09/25 15:58:45  peiyongz
  78.  * DTV Reorganization: new class
  79.  *
  80.  */
  81. #if !defined(NCNAME_DATATYPEVALIDATOR_HPP)
  82. #define NCNAME_DATATYPEVALIDATOR_HPP
  83. #include <xercesc/validators/datatype/StringDatatypeValidator.hpp>
  84. XERCES_CPP_NAMESPACE_BEGIN
  85. class VALIDATORS_EXPORT NCNameDatatypeValidator : public StringDatatypeValidator
  86. {
  87. public:
  88.     // -----------------------------------------------------------------------
  89.     //  Public ctor/dtor
  90.     // -----------------------------------------------------------------------
  91. /** @name Constructors and Destructor */
  92.     //@{
  93.     NCNameDatatypeValidator
  94.     (
  95.         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  96.     );
  97.     NCNameDatatypeValidator
  98.     (
  99.         DatatypeValidator* const baseValidator
  100.         , RefHashTableOf<KVStringPair>* const facets
  101.         , RefArrayVectorOf<XMLCh>* const enums
  102.         , const int finalSet
  103.         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  104.     );
  105.     virtual ~NCNameDatatypeValidator();
  106. //@}
  107.     // -----------------------------------------------------------------------
  108.     // Validation methods
  109.     // -----------------------------------------------------------------------
  110.     /** @name Validation Function */
  111.     //@{
  112.     /**
  113.      * validate that a string matches the boolean datatype
  114.      * @param content A string containing the content to be validated
  115.      *
  116.      * @exception throws InvalidDatatypeException if the content is
  117.      * is not valid.
  118.      */
  119. virtual void validate(const XMLCh* const content);
  120.     //@}
  121.     // -----------------------------------------------------------------------
  122.     // Compare methods
  123.     // -----------------------------------------------------------------------
  124.     /** @name Compare Function */
  125.     //@{
  126.     /**
  127.      * Compare two boolean data types
  128.      *
  129.      * @param content1
  130.      * @param content2
  131.      * @return
  132.      */
  133.     virtual int compare(const XMLCh* const, const XMLCh* const);
  134.     //@}
  135.     /**
  136.       * Returns an instance of the base datatype validator class
  137.   * Used by the DatatypeValidatorFactory.
  138.       */
  139.     virtual DatatypeValidator* newInstance
  140.     (
  141.         RefHashTableOf<KVStringPair>* const facets
  142.         , RefArrayVectorOf<XMLCh>* const enums
  143.         , const int finalSet
  144.         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  145.     );
  146. protected:
  147.     //
  148.     // ctor provided to be used by derived classes
  149.     //
  150.     NCNameDatatypeValidator
  151.     (
  152.         DatatypeValidator* const baseValidator
  153.         , RefHashTableOf<KVStringPair>* const facets
  154.         , const int finalSet
  155.         , const ValidatorType type
  156.         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
  157.     );
  158.     virtual void checkValueSpace(const XMLCh* const content);
  159. private:
  160.     // -----------------------------------------------------------------------
  161.     //  Private data members
  162.     //
  163. //
  164.     // -----------------------------------------------------------------------
  165. };
  166. XERCES_CPP_NAMESPACE_END
  167. #endif
  168. /**
  169.   * End of file NCNameDatatypeValidator.hpp
  170.   */