GME  13
BlockRangeFactory.cpp
Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  * 
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  * 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 /*
00019  * $Id: BlockRangeFactory.cpp 678879 2008-07-22 20:05:05Z amassari $
00020  */
00021 
00022 // ---------------------------------------------------------------------------
00023 //  Includes
00024 // ---------------------------------------------------------------------------
00025 #include <xercesc/util/regx/BlockRangeFactory.hpp>
00026 #include <xercesc/util/regx/RangeToken.hpp>
00027 #include <xercesc/util/regx/RegxDefs.hpp>
00028 #include <xercesc/util/regx/TokenFactory.hpp>
00029 #include <xercesc/util/regx/RangeTokenMap.hpp>
00030 #include <xercesc/util/XMLString.hpp>
00031 
00032 XERCES_CPP_NAMESPACE_BEGIN
00033 
00034 // ---------------------------------------------------------------------------
00035 //  Local static data
00036 // ---------------------------------------------------------------------------
00037 const int   BLOCKNAMESIZE = 93;
00038 
00039 // Block Names IsX
00040 // only define Specials as FEFF..FEFF, missing Specials as FFF0..FFFD, add manually
00041 // only define private use as E000..F8FF,
00042 //    missing 2 private use (F0000..FFFFD and 100000..10FFFD), add manually
00043 const XMLCh fgBlockNames[][50] =
00044 {
00045     { chLatin_I, chLatin_s, chLatin_B, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chLatin_L, chLatin_a,
00046       chLatin_t, chLatin_i, chLatin_n,  chNull },
00047     { chLatin_I, chLatin_s, chLatin_L, chLatin_a, chLatin_t, chLatin_i, chLatin_n, chDash, chDigit_1,
00048       chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_l, chLatin_e, chLatin_m, chLatin_e,
00049       chLatin_n, chLatin_t,  chNull },
00050     { chLatin_I, chLatin_s, chLatin_L, chLatin_a, chLatin_t, chLatin_i, chLatin_n, chLatin_E, chLatin_x,
00051       chLatin_t, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chDash, chLatin_A,
00052        chNull },
00053     { chLatin_I, chLatin_s, chLatin_L, chLatin_a, chLatin_t, chLatin_i, chLatin_n, chLatin_E, chLatin_x,
00054       chLatin_t, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chDash, chLatin_B,
00055        chNull },
00056     { chLatin_I, chLatin_s, chLatin_I, chLatin_P, chLatin_A, chLatin_E, chLatin_x, chLatin_t, chLatin_e,
00057       chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_s,  chNull },
00058     { chLatin_I, chLatin_s, chLatin_S, chLatin_p, chLatin_a, chLatin_c, chLatin_i, chLatin_n, chLatin_g,
00059       chLatin_M, chLatin_o, chLatin_d, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_r,
00060       chLatin_L, chLatin_e, chLatin_t, chLatin_t, chLatin_e, chLatin_r, chLatin_s,
00061        chNull },
00062     { chLatin_I, chLatin_s, chLatin_C, chLatin_o, chLatin_m, chLatin_b, chLatin_i, chLatin_n, chLatin_i, chLatin_n,
00063       chLatin_g, chLatin_D, chLatin_i, chLatin_a, chLatin_c, chLatin_r, chLatin_i,
00064       chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_l, chLatin_M, chLatin_a,
00065       chLatin_r, chLatin_k, chLatin_s,  chNull },
00066     { chLatin_I, chLatin_s, chLatin_G, chLatin_r, chLatin_e, chLatin_e, chLatin_k,  chNull },
00067     { chLatin_I, chLatin_s, chLatin_C, chLatin_y, chLatin_r, chLatin_i, chLatin_l, chLatin_l, chLatin_i, chLatin_c,
00068        chNull },
00069     { chLatin_I, chLatin_s, chLatin_A, chLatin_r, chLatin_m, chLatin_e, chLatin_n, chLatin_i, chLatin_a, chLatin_n,
00070        chNull },
00071     { chLatin_I, chLatin_s, chLatin_H, chLatin_e, chLatin_b, chLatin_r, chLatin_e, chLatin_w,  chNull },
00072     { chLatin_I, chLatin_s, chLatin_A, chLatin_r, chLatin_a, chLatin_b, chLatin_i, chLatin_c,  chNull },
00073     { chLatin_I, chLatin_s, chLatin_S, chLatin_y, chLatin_r, chLatin_i, chLatin_a, chLatin_c,  chNull },
00074     { chLatin_I, chLatin_s, chLatin_T, chLatin_h, chLatin_a, chLatin_a, chLatin_n, chLatin_a,  chNull },
00075     { chLatin_I, chLatin_s, chLatin_D, chLatin_e, chLatin_v, chLatin_a, chLatin_n, chLatin_a, chLatin_g, chLatin_a,
00076       chLatin_r, chLatin_i,  chNull },
00077     { chLatin_I, chLatin_s, chLatin_B, chLatin_e, chLatin_n, chLatin_g, chLatin_a, chLatin_l, chLatin_i,  chNull },
00078     { chLatin_I, chLatin_s, chLatin_G, chLatin_u, chLatin_r, chLatin_m, chLatin_u, chLatin_k, chLatin_h, chLatin_i,
00079        chNull },
00080     { chLatin_I, chLatin_s, chLatin_G, chLatin_u, chLatin_j, chLatin_a, chLatin_r, chLatin_a, chLatin_t, chLatin_i,
00081        chNull },
00082     { chLatin_I, chLatin_s, chLatin_O, chLatin_r, chLatin_i, chLatin_y, chLatin_a,  chNull },
00083     { chLatin_I, chLatin_s, chLatin_T, chLatin_a, chLatin_m, chLatin_i, chLatin_l,  chNull },
00084     { chLatin_I, chLatin_s, chLatin_T, chLatin_e, chLatin_l, chLatin_u, chLatin_g, chLatin_u,  chNull },
00085     { chLatin_I, chLatin_s, chLatin_K, chLatin_a, chLatin_n, chLatin_n, chLatin_a, chLatin_d, chLatin_a,  chNull },
00086     { chLatin_I, chLatin_s, chLatin_M, chLatin_a, chLatin_l, chLatin_a, chLatin_y, chLatin_a, chLatin_l, chLatin_a,
00087       chLatin_m,  chNull },
00088     { chLatin_I, chLatin_s, chLatin_S, chLatin_i, chLatin_n, chLatin_h, chLatin_a, chLatin_l, chLatin_a,  chNull },
00089     { chLatin_I, chLatin_s, chLatin_T, chLatin_h, chLatin_a, chLatin_i,  chNull },
00090     { chLatin_I, chLatin_s, chLatin_L, chLatin_a, chLatin_o,  chNull },
00091     { chLatin_I, chLatin_s, chLatin_T, chLatin_i, chLatin_b, chLatin_e, chLatin_t, chLatin_a, chLatin_n,  chNull },
00092     { chLatin_I, chLatin_s, chLatin_M, chLatin_y, chLatin_a, chLatin_n, chLatin_m, chLatin_a, chLatin_r,  chNull },
00093     { chLatin_I, chLatin_s, chLatin_G, chLatin_e, chLatin_o, chLatin_r, chLatin_g, chLatin_i, chLatin_a, chLatin_n,
00094        chNull },
00095     { chLatin_I, chLatin_s, chLatin_H, chLatin_a, chLatin_n, chLatin_g, chLatin_u, chLatin_l, chLatin_J,
00096       chLatin_a, chLatin_m, chLatin_o,  chNull },
00097     { chLatin_I, chLatin_s, chLatin_E, chLatin_t, chLatin_h, chLatin_i, chLatin_o, chLatin_p, chLatin_i,  chLatin_c,
00098        chNull },
00099     { chLatin_I, chLatin_s, chLatin_C, chLatin_h, chLatin_e, chLatin_r, chLatin_o, chLatin_k, chLatin_e,  chLatin_e,
00100        chNull },
00101     { chLatin_I, chLatin_s, chLatin_U, chLatin_n, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
00102       chLatin_C, chLatin_a, chLatin_n, chLatin_a, chLatin_d, chLatin_i, chLatin_a, chLatin_n,
00103       chLatin_A, chLatin_b, chLatin_o, chLatin_r, chLatin_i, chLatin_g, chLatin_i, chLatin_n, chLatin_a, chLatin_l,
00104       chLatin_S, chLatin_y, chLatin_l, chLatin_l, chLatin_a, chLatin_b, chLatin_i, chLatin_c, chLatin_s, chNull },
00105     { chLatin_I, chLatin_s, chLatin_O, chLatin_g, chLatin_h, chLatin_a, chLatin_m, chNull },
00106     { chLatin_I, chLatin_s, chLatin_R, chLatin_u, chLatin_n, chLatin_i, chLatin_c, chNull },
00107     { chLatin_I, chLatin_s, chLatin_K, chLatin_h, chLatin_m, chLatin_e, chLatin_r, chNull },
00108     { chLatin_I, chLatin_s, chLatin_M, chLatin_o, chLatin_n, chLatin_g, chLatin_o, chLatin_l, chLatin_i,
00109       chLatin_a, chLatin_n, chNull },
00110     { chLatin_I, chLatin_s, chLatin_L, chLatin_a, chLatin_t, chLatin_i, chLatin_n, chLatin_E, chLatin_x,
00111       chLatin_t, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chLatin_A,
00112       chLatin_d, chLatin_d, chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_a,
00113       chLatin_l,  chNull },
00114     { chLatin_I, chLatin_s, chLatin_G, chLatin_r, chLatin_e, chLatin_e, chLatin_k, chLatin_E, chLatin_x,
00115       chLatin_t, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_d,  chNull },
00116     { chLatin_I, chLatin_s, chLatin_G, chLatin_e, chLatin_n, chLatin_e, chLatin_r, chLatin_a, chLatin_l,
00117       chLatin_P, chLatin_u, chLatin_n, chLatin_c, chLatin_t, chLatin_u, chLatin_a, chLatin_t,
00118       chLatin_i, chLatin_o, chLatin_n,  chNull },
00119     { chLatin_I, chLatin_s, chLatin_S, chLatin_u, chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_c, chLatin_r,
00120       chLatin_i, chLatin_p, chLatin_t, chLatin_s, chLatin_a, chLatin_n, chLatin_d,
00121       chLatin_S, chLatin_u, chLatin_b, chLatin_s, chLatin_c, chLatin_r, chLatin_i,
00122       chLatin_p, chLatin_t, chLatin_s,  chNull },
00123     { chLatin_I, chLatin_s, chLatin_C, chLatin_u, chLatin_r, chLatin_r, chLatin_e, chLatin_n, chLatin_c, chLatin_y,
00124       chLatin_S, chLatin_y, chLatin_m, chLatin_b, chLatin_o, chLatin_l, chLatin_s,
00125        chNull },
00126     { chLatin_I, chLatin_s, chLatin_C, chLatin_o, chLatin_m, chLatin_b, chLatin_i, chLatin_n, chLatin_i, chLatin_n,
00127       chLatin_g, chLatin_M, chLatin_a, chLatin_r, chLatin_k, chLatin_s,
00128       chLatin_f, chLatin_o, chLatin_r, chLatin_S, chLatin_y, chLatin_m, chLatin_b,
00129       chLatin_o, chLatin_l, chLatin_s,  chNull },
00130     { chLatin_I, chLatin_s, chLatin_L, chLatin_e, chLatin_t, chLatin_t, chLatin_e, chLatin_r, chLatin_l, chLatin_i,
00131       chLatin_k, chLatin_e, chLatin_S, chLatin_y, chLatin_m, chLatin_b, chLatin_o,
00132       chLatin_l, chLatin_s,  chNull },
00133     { chLatin_I, chLatin_s, chLatin_N, chLatin_u, chLatin_m, chLatin_b, chLatin_e, chLatin_r, chLatin_F,
00134       chLatin_o, chLatin_r, chLatin_m, chLatin_s,  chNull },
00135     { chLatin_I, chLatin_s, chLatin_A, chLatin_r, chLatin_r, chLatin_o, chLatin_w, chLatin_s,  chNull },
00136     { chLatin_I, chLatin_s, chLatin_M, chLatin_a, chLatin_t, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_t,
00137       chLatin_i, chLatin_c, chLatin_a, chLatin_l, chLatin_O, chLatin_p, chLatin_e,
00138       chLatin_r, chLatin_a, chLatin_t, chLatin_o, chLatin_r, chLatin_s,  chNull },
00139     { chLatin_I, chLatin_s, chLatin_M, chLatin_i, chLatin_s, chLatin_c, chLatin_e, chLatin_l, chLatin_l, chLatin_a,
00140       chLatin_n, chLatin_e, chLatin_o, chLatin_u, chLatin_s, chLatin_T, chLatin_e,
00141       chLatin_c, chLatin_h, chLatin_n, chLatin_i, chLatin_c, chLatin_a, chLatin_l,  chNull },
00142     { chLatin_I, chLatin_s, chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_r, chLatin_o, chLatin_l,
00143       chLatin_P, chLatin_i, chLatin_c, chLatin_t, chLatin_u, chLatin_r, chLatin_e, chLatin_s,
00144        chNull },
00145     { chLatin_I, chLatin_s, chLatin_O, chLatin_p, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_l,
00146       chLatin_C, chLatin_h, chLatin_a, chLatin_r, chLatin_a, chLatin_c, chLatin_t, chLatin_e,
00147       chLatin_r, chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_g, chLatin_n,
00148       chLatin_i, chLatin_t, chLatin_i, chLatin_o, chLatin_n,  chNull },
00149     { chLatin_I, chLatin_s, chLatin_E, chLatin_n, chLatin_c, chLatin_l, chLatin_o, chLatin_s, chLatin_e, chLatin_d,
00150       chLatin_A, chLatin_l, chLatin_p, chLatin_h, chLatin_a, chLatin_n, chLatin_u,
00151       chLatin_m, chLatin_e, chLatin_r, chLatin_i, chLatin_c, chLatin_s,  chNull },
00152     { chLatin_I, chLatin_s, chLatin_B, chLatin_o, chLatin_x, chLatin_D, chLatin_r, chLatin_a, chLatin_w,
00153       chLatin_i, chLatin_n, chLatin_g,  chNull },
00154     { chLatin_I, chLatin_s, chLatin_B, chLatin_l, chLatin_o, chLatin_c, chLatin_k, chLatin_E, chLatin_l,
00155       chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t, chLatin_s,  chNull },
00156     { chLatin_I, chLatin_s, chLatin_G, chLatin_e, chLatin_o, chLatin_m, chLatin_e, chLatin_t, chLatin_r, chLatin_i,
00157       chLatin_c, chLatin_S, chLatin_h, chLatin_a, chLatin_p, chLatin_e, chLatin_s,
00158        chNull },
00159     { chLatin_I, chLatin_s, chLatin_M, chLatin_i, chLatin_s, chLatin_c, chLatin_e, chLatin_l, chLatin_l, chLatin_a,
00160       chLatin_n, chLatin_e, chLatin_o, chLatin_u, chLatin_s, chLatin_S, chLatin_y,
00161       chLatin_m, chLatin_b, chLatin_o, chLatin_l, chLatin_s,  chNull },
00162     { chLatin_I, chLatin_s, chLatin_D, chLatin_i, chLatin_n, chLatin_g, chLatin_b, chLatin_a, chLatin_t, chLatin_s,
00163        chNull },
00164     { chLatin_I, chLatin_s, chLatin_B, chLatin_r, chLatin_a, chLatin_i, chLatin_l, chLatin_l, chLatin_e,
00165       chLatin_P, chLatin_a, chLatin_t, chLatin_t, chLatin_e, chLatin_r, chLatin_n, chLatin_s, chNull },
00166     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_R, chLatin_a, chLatin_d, chLatin_i, chLatin_c,
00167       chLatin_a, chLatin_l, chLatin_s, chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_l, chLatin_e, chLatin_m,
00168       chLatin_e, chLatin_n, chLatin_t,  chNull },
00169     { chLatin_I, chLatin_s, chLatin_K, chLatin_a, chLatin_n, chLatin_g, chLatin_x, chLatin_i,
00170       chLatin_R, chLatin_a, chLatin_d, chLatin_i, chLatin_c, chLatin_a, chLatin_l, chLatin_s, chNull },
00171     { chLatin_I, chLatin_s, chLatin_I, chLatin_d, chLatin_e, chLatin_o, chLatin_g, chLatin_r, chLatin_a, chLatin_p,
00172       chLatin_h, chLatin_i, chLatin_c, chLatin_D, chLatin_e, chLatin_s, chLatin_c, chLatin_r, chLatin_i, chLatin_p,
00173       chLatin_t, chLatin_i, chLatin_o, chLatin_n, chLatin_C, chLatin_h, chLatin_a, chLatin_r, chLatin_a, chLatin_c,
00174       chLatin_t, chLatin_e, chLatin_r, chLatin_s, chNull },
00175     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_S, chLatin_y, chLatin_m, chLatin_b,
00176       chLatin_o, chLatin_l, chLatin_s, chLatin_a, chLatin_n, chLatin_d,
00177       chLatin_P, chLatin_u, chLatin_n, chLatin_c, chLatin_t, chLatin_u, chLatin_a, chLatin_t,
00178       chLatin_i, chLatin_o, chLatin_n,  chNull },
00179     { chLatin_I, chLatin_s, chLatin_H, chLatin_i, chLatin_r, chLatin_a, chLatin_g, chLatin_a, chLatin_n, chLatin_a,
00180        chNull },
00181     { chLatin_I, chLatin_s, chLatin_K, chLatin_a, chLatin_t, chLatin_a, chLatin_k, chLatin_a, chLatin_n, chLatin_a,
00182        chNull },
00183     { chLatin_I, chLatin_s, chLatin_B, chLatin_o, chLatin_p, chLatin_o, chLatin_m, chLatin_o, chLatin_f, chLatin_o,
00184        chNull },
00185     { chLatin_I, chLatin_s, chLatin_H, chLatin_a, chLatin_n, chLatin_g, chLatin_u, chLatin_l, chLatin_C,
00186       chLatin_o, chLatin_m, chLatin_p, chLatin_a, chLatin_t, chLatin_i, chLatin_b, chLatin_i,
00187       chLatin_l, chLatin_i, chLatin_t, chLatin_y, chLatin_J, chLatin_a, chLatin_m,
00188       chLatin_o,  chNull },
00189     { chLatin_I, chLatin_s, chLatin_K, chLatin_a, chLatin_n, chLatin_b, chLatin_u, chLatin_n,  chNull },
00190     { chLatin_I, chLatin_s, chLatin_B, chLatin_o, chLatin_p, chLatin_o, chLatin_m, chLatin_o, chLatin_f, chLatin_o,
00191       chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_d, chNull },
00192     { chLatin_I, chLatin_s, chLatin_E, chLatin_n, chLatin_c, chLatin_l, chLatin_o, chLatin_s, chLatin_e, chLatin_d,
00193       chLatin_C, chLatin_J, chLatin_K, chLatin_L, chLatin_e, chLatin_t,
00194       chLatin_t, chLatin_e, chLatin_r, chLatin_s, chLatin_a, chLatin_n, chLatin_d,
00195       chLatin_M, chLatin_o, chLatin_n, chLatin_t, chLatin_h, chLatin_s,  chNull },
00196     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_C, chLatin_o, chLatin_m, chLatin_p,
00197       chLatin_a, chLatin_t, chLatin_i, chLatin_b, chLatin_i, chLatin_l, chLatin_i, chLatin_t,
00198       chLatin_y,  chNull },
00199     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_U, chLatin_n, chLatin_i, chLatin_f,
00200       chLatin_i, chLatin_e, chLatin_d, chLatin_I, chLatin_d, chLatin_e, chLatin_o,
00201       chLatin_g, chLatin_r, chLatin_a, chLatin_p, chLatin_h, chLatin_s,
00202       chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_A,
00203       chNull },
00204     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_U, chLatin_n, chLatin_i, chLatin_f,
00205       chLatin_i, chLatin_e, chLatin_d, chLatin_I, chLatin_d, chLatin_e, chLatin_o,
00206       chLatin_g, chLatin_r, chLatin_a, chLatin_p, chLatin_h, chLatin_s,  chNull },
00207     { chLatin_I, chLatin_s, chLatin_Y, chLatin_i, chLatin_S, chLatin_y, chLatin_l, chLatin_l, chLatin_a,
00208       chLatin_b, chLatin_l, chLatin_e, chLatin_s, chNull },
00209     { chLatin_I, chLatin_s, chLatin_Y, chLatin_i, chLatin_R, chLatin_a, chLatin_d, chLatin_i, chLatin_c,
00210       chLatin_a, chLatin_l, chLatin_s, chNull },
00211     { chLatin_I, chLatin_s, chLatin_H, chLatin_a, chLatin_n, chLatin_g, chLatin_u, chLatin_l, chLatin_S,
00212       chLatin_y, chLatin_l, chLatin_l, chLatin_a, chLatin_b, chLatin_l, chLatin_e, chLatin_s,
00213        chNull },
00214     { chLatin_I, chLatin_s, chLatin_P, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_e,
00215       chLatin_U, chLatin_s, chLatin_e,  chNull },
00216     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_C, chLatin_o, chLatin_m, chLatin_p,
00217       chLatin_a, chLatin_t, chLatin_i, chLatin_b, chLatin_i, chLatin_l, chLatin_i, chLatin_t,
00218       chLatin_y, chLatin_I, chLatin_d, chLatin_e, chLatin_o, chLatin_g, chLatin_r,
00219       chLatin_a, chLatin_p, chLatin_h, chLatin_s,  chNull },
00220     { chLatin_I, chLatin_s, chLatin_A, chLatin_l, chLatin_p, chLatin_h, chLatin_a, chLatin_b, chLatin_e, chLatin_t,
00221       chLatin_i, chLatin_c, chLatin_P, chLatin_r, chLatin_e, chLatin_s, chLatin_e,
00222       chLatin_n, chLatin_t, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n,
00223       chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_s,  chNull },
00224     { chLatin_I, chLatin_s, chLatin_A, chLatin_r, chLatin_a, chLatin_b, chLatin_i, chLatin_c, chLatin_P,
00225       chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t,
00226       chLatin_i, chLatin_o, chLatin_n, chLatin_F, chLatin_o, chLatin_r, chLatin_m,
00227       chLatin_s, chDash, chLatin_A,  chNull },
00228     { chLatin_I, chLatin_s, chLatin_C, chLatin_o, chLatin_m, chLatin_b, chLatin_i, chLatin_n, chLatin_i, chLatin_n,
00229       chLatin_g, chLatin_H, chLatin_a, chLatin_l, chLatin_f, chLatin_M,
00230       chLatin_a, chLatin_r, chLatin_k, chLatin_s,  chNull },
00231     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_C, chLatin_o, chLatin_m, chLatin_p,
00232       chLatin_a, chLatin_t, chLatin_i, chLatin_b, chLatin_i, chLatin_l, chLatin_i, chLatin_t,
00233       chLatin_y, chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_s,  chNull },
00234     { chLatin_I, chLatin_s, chLatin_S, chLatin_m, chLatin_a, chLatin_l, chLatin_l, chLatin_F, chLatin_o,
00235       chLatin_r, chLatin_m, chLatin_V, chLatin_a, chLatin_r, chLatin_i, chLatin_a,
00236       chLatin_n, chLatin_t, chLatin_s,  chNull },
00237     { chLatin_I, chLatin_s, chLatin_A, chLatin_r, chLatin_a, chLatin_b, chLatin_i, chLatin_c, chLatin_P,
00238       chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_n, chLatin_t, chLatin_a, chLatin_t,
00239       chLatin_i, chLatin_o, chLatin_n, chLatin_F, chLatin_o, chLatin_r, chLatin_m,
00240       chLatin_s, chDash, chLatin_B,  chNull },
00241     { chLatin_I, chLatin_s, chLatin_S, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_a, chLatin_l, chLatin_s,
00242        chNull },
00243     { chLatin_I, chLatin_s, chLatin_H, chLatin_a, chLatin_l, chLatin_f, chLatin_w, chLatin_i, chLatin_d, chLatin_t,
00244       chLatin_h, chLatin_a, chLatin_n, chLatin_d, chLatin_F, chLatin_u,
00245       chLatin_l, chLatin_l, chLatin_w, chLatin_i, chLatin_d, chLatin_t, chLatin_h,
00246       chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_s,  chNull },
00247     { chLatin_I, chLatin_s, chLatin_O, chLatin_l, chLatin_d, chLatin_I, chLatin_t, chLatin_a, chLatin_l, chLatin_i,
00248       chLatin_c, chNull },
00249     { chLatin_I, chLatin_s, chLatin_G, chLatin_o, chLatin_t, chLatin_h, chLatin_i, chLatin_c, chNull },
00250     { chLatin_I, chLatin_s, chLatin_D, chLatin_e, chLatin_s, chLatin_e, chLatin_r, chLatin_e, chLatin_t, chNull },
00251     { chLatin_I, chLatin_s, chLatin_B, chLatin_y, chLatin_z, chLatin_a, chLatin_n, chLatin_t, chLatin_i, chLatin_n, chLatin_e,
00252       chLatin_M, chLatin_u, chLatin_s, chLatin_i, chLatin_c, chLatin_a, chLatin_l,
00253       chLatin_S, chLatin_y, chLatin_m, chLatin_b, chLatin_o, chLatin_l, chLatin_s, chNull },
00254     { chLatin_I, chLatin_s, chLatin_M, chLatin_u, chLatin_s, chLatin_i, chLatin_c, chLatin_a, chLatin_l,
00255       chLatin_S, chLatin_y, chLatin_m, chLatin_b, chLatin_o, chLatin_l, chLatin_s, chNull },
00256     { chLatin_I, chLatin_s, chLatin_M, chLatin_a, chLatin_t, chLatin_h, chLatin_e,
00257       chLatin_m, chLatin_a, chLatin_t, chLatin_i, chLatin_c, chLatin_a, chLatin_l,
00258       chLatin_A, chLatin_l, chLatin_p, chLatin_h, chLatin_a,
00259       chLatin_n, chLatin_u, chLatin_m, chLatin_e, chLatin_r, chLatin_i, chLatin_c,
00260       chLatin_S, chLatin_y, chLatin_m, chLatin_b, chLatin_o, chLatin_l, chLatin_s, chNull },
00261     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_U, chLatin_n, chLatin_i, chLatin_f,
00262       chLatin_i, chLatin_e, chLatin_d, chLatin_I, chLatin_d, chLatin_e, chLatin_o,
00263       chLatin_g, chLatin_r, chLatin_a, chLatin_p, chLatin_h, chLatin_s,
00264       chLatin_E, chLatin_x, chLatin_t, chLatin_e, chLatin_n, chLatin_s, chLatin_i, chLatin_o, chLatin_n, chLatin_B,
00265       chNull },
00266     { chLatin_I, chLatin_s, chLatin_C, chLatin_J, chLatin_K, chLatin_C, chLatin_o, chLatin_m, chLatin_p,
00267       chLatin_a, chLatin_t, chLatin_i, chLatin_b, chLatin_i, chLatin_l, chLatin_i, chLatin_t, chLatin_y,
00268       chLatin_I, chLatin_d, chLatin_e, chLatin_o, chLatin_g, chLatin_r, chLatin_a, chLatin_p, chLatin_h, chLatin_s,
00269       chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t,  chNull },
00270     { chLatin_I, chLatin_s, chLatin_T, chLatin_a, chLatin_g, chLatin_s, chNull },
00271 };
00272 
00273 const XMLInt32 blockRanges[] =
00274 {
00275     0x0000,0x007F,0x0080,0x00FF,0x0100,0x017F,0x0180,0x024F,0x0250,0x02AF,0x02B0,0x02FF,
00276     0x0300,0x036F,0x0370,0x03FF,0x0400,0x04FF,0x0530,0x058F,0x0590,0x05FF,0x0600,0x06FF,
00277     0x0700,0x074F,0x0780,0x07BF,0x0900,0x097F,0x0980,0x09FF,0x0A00,0x0A7F,0x0A80,0x0AFF,
00278     0x0B00,0x0B7F,0x0B80,0x0BFF,0x0C00,0x0C7F,0x0C80,0x0CFF,0x0D00,0x0D7F,0x0D80,0x0DFF,
00279     0x0E00,0x0E7F,0x0E80,0x0EFF,0x0F00,0x0FFF,0x1000,0x109F,0x10A0,0x10FF,0x1100,0x11FF,
00280     0x1200,0x137F,0x13A0,0x13FF,0x1400,0x167F,0x1680,0x169F,0x16A0,0x16FF,0x1780,0x17FF,
00281     0x1800,0x18AF,0x1E00,0x1EFF,0x1F00,0x1FFF,0x2000,0x206F,0x2070,0x209F,0x20A0,0x20CF,
00282     0x20D0,0x20FF,0x2100,0x214F,0x2150,0x218F,0x2190,0x21FF,0x2200,0x22FF,0x2300,0x23FF,
00283     0x2400,0x243F,0x2440,0x245F,0x2460,0x24FF,0x2500,0x257F,0x2580,0x259F,0x25A0,0x25FF,
00284     0x2600,0x26FF,0x2700,0x27BF,0x2800,0x28FF,0x2E80,0x2EFF,0x2F00,0x2FDF,0x2FF0,0x2FFF,
00285     0x3000,0x303F,0x3040,0x309F,0x30A0,0x30FF,0x3100,0x312F,0x3130,0x318F,0x3190,0x319F,
00286     0x31A0,0x31BF,0x3200,0x32FF,0x3300,0x33FF,0x3400,0x4DB5,0x4E00,0x9FFF,0xA000,0xA48F,
00287     0xA490,0xA4CF,0xAC00,0xD7A3,0xE000,0xF8FF,0xF900,0xFAFF,0xFB00,0xFB4F,0xFB50,0xFDFF,
00288     0xFE20,0xFE2F,0xFE30,0xFE4F,0xFE50,0xFE6F,0xFE70,0xFEFE,0xFEFF,0xFEFF,0xFF00,0xFFEF,
00289     0x10300,0x1032F,0x10330,0x1034F,0x10400,0x1044F,0x1D000,0x1D0FF,0x1D100,0x1D1FF,
00290     0x1D400,0x1D7FF,0x20000,0x2A6D6,0x2F800,0x2FA1F,0xE0000,0xE007F, chNull
00291 };
00292 
00293 // ---------------------------------------------------------------------------
00294 //  BlockRangeFactory: Constructors and Destructor
00295 // ---------------------------------------------------------------------------
00296 BlockRangeFactory::BlockRangeFactory()
00297 {
00298 
00299 }
00300 
00301 BlockRangeFactory::~BlockRangeFactory() {
00302 
00303 }
00304 
00305 // ---------------------------------------------------------------------------
00306 //  BlockRangeFactory: Range creation methods
00307 // ---------------------------------------------------------------------------
00308 void BlockRangeFactory::buildRanges(RangeTokenMap *rangeTokMap) {
00309 
00310     if (fRangesCreated)
00311         return;
00312 
00313     if (!fKeywordsInitialized) {
00314         initializeKeywordMap(rangeTokMap);
00315     }
00316 
00317     TokenFactory* tokFactory = rangeTokMap->getTokenFactory();
00318 
00319     //for performance, once the desired specials and private use are found
00320     //don't need to compareString anymore
00321     bool foundSpecial = false;
00322     bool foundPrivate = false;
00323 
00324     for (int i=0; i < BLOCKNAMESIZE; i++) {
00325         RangeToken* tok = tokFactory->createRange();
00326         tok->addRange(blockRanges[i*2], blockRanges[(i*2)+1]);
00327 
00328         if (!foundSpecial && XMLString::equals((XMLCh*)fgBlockNames[i] , (XMLCh*) fgBlockIsSpecials)) {
00329             tok->addRange(0xFFF0, 0xFFFD);
00330             foundSpecial = true;
00331         }
00332         if (!foundPrivate && XMLString::equals((XMLCh*)fgBlockNames[i] , (XMLCh*) fgBlockIsPrivateUse)) {
00333             tok->addRange(0xF0000, 0xFFFFD);
00334             tok->addRange(0x100000, 0x10FFFD);
00335             foundPrivate = true;
00336         }
00337 
00338         // Build the internal map.
00339         tok->createMap();
00340         rangeTokMap->setRangeToken(fgBlockNames[i], tok);
00341         tok = RangeToken::complementRanges(tok, tokFactory);
00342         // Build the internal map.
00343         tok->createMap();
00344         rangeTokMap->setRangeToken(fgBlockNames[i], tok , true);
00345     }
00346 
00347     fRangesCreated = true;
00348 }
00349 
00350 // ---------------------------------------------------------------------------
00351 //  BlockRangeFactory: Range creation methods
00352 // ---------------------------------------------------------------------------
00353 void BlockRangeFactory::initializeKeywordMap(RangeTokenMap *rangeTokMap) {
00354 
00355     if (fKeywordsInitialized)
00356         return;
00357 
00358     for (int i=0; i< BLOCKNAMESIZE; i++) {
00359         rangeTokMap->addKeywordMap(fgBlockNames[i], fgBlockCategory);
00360     }
00361 
00362     fKeywordsInitialized = true;
00363 }
00364 
00365 XERCES_CPP_NAMESPACE_END
00366