You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/11/09 22:27:21 UTC

cvs commit: xml-xerces/c/src/util/regx BlockRangeFactory.cpp RegxDefs.hpp

tng         01/11/09 13:27:21

  Modified:    c/src/util/regx BlockRangeFactory.cpp RegxDefs.hpp
  Log:
  Schema Regx Fix: manually add the extra specials and private use block range.
  
  Revision  Changes    Path
  1.6       +24 -15    xml-xerces/c/src/util/regx/BlockRangeFactory.cpp
  
  Index: BlockRangeFactory.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/regx/BlockRangeFactory.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BlockRangeFactory.cpp	2001/11/09 18:10:09	1.5
  +++ BlockRangeFactory.cpp	2001/11/09 21:27:21	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: BlockRangeFactory.cpp,v $
  + * Revision 1.6  2001/11/09 21:27:21  tng
  + * Schema Regx Fix: manually add the extra specials and private use block range.
  + *
    * Revision 1.5  2001/11/09 18:10:09  tng
    * Schema Regx: Block name 'X' should begin with 'IsX'.  And add missing block names and range.
    *
  @@ -105,9 +108,12 @@
   // ---------------------------------------------------------------------------
   //  Local static data
   // ---------------------------------------------------------------------------
  -const int   BLOCKNAMESIZE = 68;
  +const int   BLOCKNAMESIZE = 96;
   
   // Block Names IsX
  +// only define Specials as FEFF..FEFF, missing Specials as FFF0..FFFD, add manually
  +// only define private use as E000..F8FF,
  +//    missing 2 private use (F0000..FFFFD and 100000..10FFFD), add manually
   const XMLCh fgBlockNames[][BLOCKNAMESIZE] =
   {
       { chLatin_I, chLatin_s, chLatin_B, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chLatin_L, chLatin_a,
  @@ -320,8 +326,6 @@
         chLatin_h, chLatin_a, chLatin_n, chLatin_d, chLatin_F, chLatin_u,
         chLatin_l, chLatin_l, chLatin_w, chLatin_i, chLatin_d, chLatin_t, chLatin_h,
         chLatin_F, chLatin_o, chLatin_r, chLatin_m, chLatin_s,  chNull },
  -    { chLatin_I, chLatin_s, chLatin_S, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_a, chLatin_l, chLatin_s,
  -       chNull },
       { chLatin_I, chLatin_s, chLatin_O, chLatin_l, chLatin_d, chLatin_I, chLatin_t, chLatin_a, chLatin_l, chLatin_i,
         chLatin_c, chNull },
       { chLatin_I, chLatin_s, chLatin_G, chLatin_o, chLatin_t, chLatin_h, chLatin_i, chLatin_c, chNull },
  @@ -346,10 +350,6 @@
         chLatin_I, chLatin_d, chLatin_e, chLatin_o, chLatin_g, chLatin_r, chLatin_a, chLatin_p, chLatin_h, chLatin_s,
         chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_l, chLatin_e, chLatin_m, chLatin_e, chLatin_n, chLatin_t,  chNull },
       { chLatin_I, chLatin_s, chLatin_T, chLatin_a, chLatin_g, chLatin_s, chNull },
  -    { chLatin_I, chLatin_s, chLatin_P, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_e,
  -      chLatin_U, chLatin_s, chLatin_e, chNull },
  -    { chLatin_I, chLatin_s, chLatin_P, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_e,
  -      chLatin_U, chLatin_s, chLatin_e, chNull }
   };
   
   const XMLInt32 blockRanges[] =
  @@ -368,9 +368,9 @@
       0x31A0,0x31BF,0x3200,0x32FF,0x3300,0x33FF,0x3400,0x4DB5,0x4E00,0x9FFF,0xA000,0xA48F,
       0xA490,0xA4CF,0xAC00,0xD7A3,0xD800,0xDB7F,0xDB80,0xDBFF,0xDC00,0xDFFF,0xE000,0xF8FF,
       0xF900,0xFAFF,0xFB00,0xFB4F,0xFB50,0xFDFF,0xFE20,0xFE2F,0xFE30,0xFE4F,0xFE50,0xFE6F,
  -    0xFE70,0xFEFE,0xFEFF,0xFEFF,0xFF00,0xFFEF,0xFFF0,0xFFFD,0x10300,0x1032F,0x10330,0x1034F,
  +    0xFE70,0xFEFE,0xFEFF,0xFEFF,0xFF00,0xFFEF,0x10300,0x1032F,0x10330,0x1034F,
       0x10400,0x1044F,0x1D000,0x1D0FF,0x1D100,0x1D1FF,0x1D400,0x1D7FF,0x20000,0x2A6D6,0x2F800,0x2FA1F,
  -    0xE0000,0xE007F,0xF0000,0xFFFFD,0x100000,0x10FFFD, chNull
  +    0xE0000,0xE007F, chNull
   };
   
   // ---------------------------------------------------------------------------
  @@ -399,16 +399,25 @@
       RangeTokenMap* rangeTokMap = RangeTokenMap::instance();
       TokenFactory* tokFactory = rangeTokMap->getTokenFactory();
   
  -    for (int i=0; i < BLOCKNAMESIZE; i++) {
  +    //for performance, once the desired specials and private use are found
  +    //don't need to compareString anymore
  +    bool foundSpecial = false;
  +    bool foundPrivate = false;
   
  -		RangeToken* tok = tokFactory->createRange();
  +    for (int i=0; i < BLOCKNAMESIZE; i++) {
  +        RangeToken* tok = tokFactory->createRange();
           tok->addRange(blockRanges[i*2], blockRanges[(i*2)+1]);
   
  -		if (XMLString::compareString((XMLCh*)fgBlockNames[i] , (XMLCh*) fgBlockSpecials) == 0) {
  -            tok->addRange(0xFFF0, 0xFFFd);
  +        if (!foundSpecial && !XMLString::compareString((XMLCh*)fgBlockNames[i] , (XMLCh*) fgBlockIsSpecials)) {
  +            tok->addRange(0xFFF0, 0xFFFD);
  +            foundSpecial = true;
           }
  -
  -		rangeTokMap->setRangeToken(fgBlockNames[i], tok);
  +        if (!foundPrivate && !XMLString::compareString((XMLCh*)fgBlockNames[i] , (XMLCh*) fgBlockIsPrivateUse)) {
  +            tok->addRange(0xF0000, 0xFFFFD);
  +            tok->addRange(0x100000, 0x10FFFD);
  +            foundPrivate = true;
  +        }
  +        rangeTokMap->setRangeToken(fgBlockNames[i], tok);
       }
   
       fRangesCreated = true;
  
  
  
  1.4       +9 -3      xml-xerces/c/src/util/regx/RegxDefs.hpp
  
  Index: RegxDefs.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/regx/RegxDefs.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegxDefs.hpp	2001/05/11 13:26:47	1.3
  +++ RegxDefs.hpp	2001/11/09 21:27:21	1.4
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: RegxDefs.hpp,v 1.3 2001/05/11 13:26:47 tng Exp $
  + * $Id: RegxDefs.hpp,v 1.4 2001/11/09 21:27:21 tng Exp $
    */
   
   #if !defined(REGXDEFS_HPP)
  @@ -219,10 +219,16 @@
       chLatin_N, chLatin_d, chNull
   };
   
  -const XMLCh fgBlockSpecials[] =
  +const XMLCh fgBlockIsSpecials[] =
   {
  -    chLatin_S, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_a,
  +    chLatin_I, chLatin_s, chLatin_S, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_a,
       chLatin_l, chLatin_s, chNull
  +};
  +
  +const XMLCh fgBlockIsPrivateUse[] =
  +{
  +    chLatin_I, chLatin_s, chLatin_P, chLatin_r, chLatin_i, chLatin_v, chLatin_a, chLatin_t, chLatin_e,
  +    chLatin_U, chLatin_s, chLatin_e,  chNull
   };
   
   const XMLCh fgUniLetter[] =
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org