Import from 1.9a8 tarball
[mozilla-extra.git] / extensions / xforms / nsXFormsXPathXMLUtil.h
blobbdcf17c51a469e4f53307d66f3ee2782ad63d228
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (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 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla XForms support.
17 * The Initial Developer of the Original Code is
18 * Novell, Inc.
19 * Portions created by the Initial Developer are Copyright (C) 2004
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Allan Beaufour <abeaufour@novell.com>
24 * David Landwehr <dlandwehr@novell.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include "nsString.h"
42 /**
43 * Miscellaneous utility functions for determining the class of a character, used by
44 * nsXFormsXPathScanner.
46 * @note Should be reimplemented and moved to Transformiix
49 class nsXFormsXPathXMLUtil {
50 private:
51 /** Helper function for public functions */
52 static PRBool IsInRange(const PRUnichar* range, const PRUint32 range_length, const PRUnichar c);
54 public:
55 /** Checks if a char is a whitespace */
56 static PRBool IsWhitespace(const PRUnichar c);
58 /** Checks of a char is a digit */
59 static PRBool IsDigit(const PRUnichar c);
61 /** Checks if a char is an ideographic */
62 static PRBool IsIdeographic(const PRUnichar c);
64 /** Checks if a char is a letter */
65 static PRBool IsLetter(const PRUnichar c);
67 /** Checks if a char is a base char */
68 static PRBool IsBaseChar(const PRUnichar c);
70 /** Check is a char matches the first rule of a NCName */
71 static PRBool IsNCNameChar(const PRUnichar c);
73 /** Check if a char is a combining char */
74 static PRBool IsCombiningChar(const PRUnichar c);
76 /** Check if a char is an extender */
77 static PRBool IsExtender(const PRUnichar c);