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/06/22 19:24:04 UTC

cvs commit: xml-xerces/c/src/util XMLUni.cpp XMLUni.hpp

tng         01/06/22 10:24:03

  Modified:    c/src/internal XMLScanner.cpp
               c/src/util XMLUni.cpp XMLUni.hpp
  Log:
  Move the strings as static string for better performance.
  
  Revision  Changes    Path
  1.50      +17 -101   xml-xerces/c/src/internal/XMLScanner.cpp
  
  Index: XMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/internal/XMLScanner.cpp,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- XMLScanner.cpp	2001/06/22 12:42:32	1.49
  +++ XMLScanner.cpp	2001/06/22 17:24:00	1.50
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: XMLScanner.cpp,v 1.49 2001/06/22 12:42:32 tng Exp $
  + * $Id: XMLScanner.cpp,v 1.50 2001/06/22 17:24:00 tng Exp $
    */
   
   
  @@ -3422,102 +3422,18 @@
       // [3]  S           ::= (#x20 | #x9 | #xD | #xA)+
       //
   
  -    //xml{S}
  -    const XMLCh XMLStringSpace[] =
  -    {
  -        chLatin_x, chLatin_m, chLatin_l, chSpace, chNull
  -    };
  -
  -    const XMLCh XMLStringHTab[] =
  -    {
  -        chLatin_x, chLatin_m, chLatin_l, chHTab, chNull
  -    };
  -
  -    const XMLCh XMLStringCR[] =
  -    {
  -        chLatin_x, chLatin_m, chLatin_l, chCR, chNull
  -    };
  -
  -    const XMLCh XMLStringLF[] =
  -    {
  -        chLatin_x, chLatin_m, chLatin_l, chLF, chNull
  -    };
  -
  -    //XML{S}
  -    const XMLCh XMLStringSpaceU[] =
  -    {
  -        chLatin_X, chLatin_M, chLatin_L, chSpace, chNull
  -    };
  -
  -    const XMLCh XMLStringHTabU[] =
  -    {
  -        chLatin_X, chLatin_M, chLatin_L, chHTab, chNull
  -    };
  -
  -    const XMLCh XMLStringCRU[] =
  -    {
  -        chLatin_X, chLatin_M, chLatin_L, chCR, chNull
  -    };
  -
  -    const XMLCh XMLStringLFU[] =
  -    {
  -        chLatin_X, chLatin_M, chLatin_L, chLF, chNull
  -    };
  -
  -    //<?xml{S}
  -    const XMLCh XMLDeclStringSpace[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chSpace, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringHTab[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chHTab, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringLF[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chLF, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringCR[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chCR, chNull
  -    };
  -
  -    //<?XML{S}
  -    const XMLCh XMLDeclStringSpaceU[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chSpace, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringHTabU[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chHTab, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringLFU[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chLF, chNull
  -    };
  -
  -    const XMLCh XMLDeclStringCRU[] =
  -    {
  -        chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chCR, chNull
  -    };
  -
       if (startWithAngle) {
  -        if (fReaderMgr.skippedString(XMLDeclStringSpace)
  -           || fReaderMgr.skippedString(XMLDeclStringHTab)
  -           || fReaderMgr.skippedString(XMLDeclStringLF)
  -           || fReaderMgr.skippedString(XMLDeclStringCR))
  +        if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpace)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringHTab)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringLF)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringCR))
           {
               return true;
           }
  -        else if (fReaderMgr.skippedString(XMLDeclStringSpaceU)
  -           || fReaderMgr.skippedString(XMLDeclStringHTabU)
  -           || fReaderMgr.skippedString(XMLDeclStringLFU)
  -           || fReaderMgr.skippedString(XMLDeclStringCRU))
  +        else if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpaceU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringHTabU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringLFU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLDeclStringCRU))
           {
               //
               //  Just in case, check for upper case. If found, issue
  @@ -3528,17 +3444,17 @@
           }
       }
       else {
  -        if (fReaderMgr.skippedString(XMLStringSpace)
  -           || fReaderMgr.skippedString(XMLStringHTab)
  -           || fReaderMgr.skippedString(XMLStringLF)
  -           || fReaderMgr.skippedString(XMLStringCR))
  +        if (fReaderMgr.skippedString(XMLUni::fgXMLStringSpace)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringHTab)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringLF)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringCR))
           {
               return true;
           }
  -        else if (fReaderMgr.skippedString(XMLStringSpaceU)
  -           || fReaderMgr.skippedString(XMLStringHTabU)
  -           || fReaderMgr.skippedString(XMLStringLFU)
  -           || fReaderMgr.skippedString(XMLStringCRU))
  +        else if (fReaderMgr.skippedString(XMLUni::fgXMLStringSpaceU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringHTabU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringLFU)
  +           || fReaderMgr.skippedString(XMLUni::fgXMLStringCRU))
           {
               //
               //  Just in case, check for upper case. If found, issue
  
  
  
  1.27      +84 -1     xml-xerces/c/src/util/XMLUni.cpp
  
  Index: XMLUni.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLUni.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XMLUni.cpp	2001/06/22 12:42:33	1.26
  +++ XMLUni.cpp	2001/06/22 17:24:02	1.27
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: XMLUni.cpp,v 1.26 2001/06/22 12:42:33 tng Exp $
  + * $Id: XMLUni.cpp,v 1.27 2001/06/22 17:24:02 tng Exp $
    */
   
   
  @@ -466,6 +466,89 @@
       chLatin_x, chLatin_m, chLatin_l, chNull
   };
   
  +//xml{S}
  +const XMLCh XMLUni::fgXMLStringSpace[] =
  +{
  +    chLatin_x, chLatin_m, chLatin_l, chSpace, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringHTab[] =
  +{
  +    chLatin_x, chLatin_m, chLatin_l, chHTab, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringCR[] =
  +{
  +    chLatin_x, chLatin_m, chLatin_l, chCR, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringLF[] =
  +{
  +    chLatin_x, chLatin_m, chLatin_l, chLF, chNull
  +};
  +
  +//XML{S}
  +const XMLCh XMLUni::fgXMLStringSpaceU[] =
  +{
  +    chLatin_X, chLatin_M, chLatin_L, chSpace, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringHTabU[] =
  +{
  +    chLatin_X, chLatin_M, chLatin_L, chHTab, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringCRU[] =
  +{
  +    chLatin_X, chLatin_M, chLatin_L, chCR, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLStringLFU[] =
  +{
  +    chLatin_X, chLatin_M, chLatin_L, chLF, chNull
  +};
  +
  +//<?xml{S}
  +const XMLCh XMLUni::fgXMLDeclStringSpace[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chSpace, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringHTab[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chHTab, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringLF[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chLF, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringCR[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_x, chLatin_m, chLatin_l, chCR, chNull
  +};
  +
  +//<?XML{S}
  +const XMLCh XMLUni::fgXMLDeclStringSpaceU[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chSpace, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringHTabU[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chHTab, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringLFU[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chLF, chNull
  +};
  +
  +const XMLCh XMLUni::fgXMLDeclStringCRU[] =
  +{
  +    chOpenAngle, chQuestion, chLatin_X, chLatin_M, chLatin_L, chCR, chNull
  +};
   
   const XMLCh XMLUni::fgXMLNSString[] =
   {
  
  
  
  1.28      +18 -1     xml-xerces/c/src/util/XMLUni.hpp
  
  Index: XMLUni.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/util/XMLUni.hpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- XMLUni.hpp	2001/06/22 12:42:33	1.27
  +++ XMLUni.hpp	2001/06/22 17:24:02	1.28
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: XMLUni.hpp,v 1.27 2001/06/22 12:42:33 tng Exp $
  + * $Id: XMLUni.hpp,v 1.28 2001/06/22 17:24:02 tng Exp $
    */
   
   
  @@ -156,6 +156,23 @@
       static const XMLCh fgWin1252EncodingString[];
       static const XMLCh fgXMLChEncodingString[];
       static const XMLCh fgXMLString[];
  +    static const XMLCh fgXMLStringSpace[];
  +    static const XMLCh fgXMLStringHTab[];
  +    static const XMLCh fgXMLStringCR[];
  +    static const XMLCh fgXMLStringLF[];
  +    static const XMLCh fgXMLStringSpaceU[];
  +    static const XMLCh fgXMLStringHTabU[];
  +    static const XMLCh fgXMLStringCRU[];
  +    static const XMLCh fgXMLStringLFU[];
  +    static const XMLCh fgXMLDeclStringSpace[];
  +    static const XMLCh fgXMLDeclStringHTab[];
  +    static const XMLCh fgXMLDeclStringLF[];
  +    static const XMLCh fgXMLDeclStringCR[];
  +    static const XMLCh fgXMLDeclStringSpaceU[];
  +    static const XMLCh fgXMLDeclStringHTabU[];
  +    static const XMLCh fgXMLDeclStringLFU[];
  +    static const XMLCh fgXMLDeclStringCRU[];
  +
       static const XMLCh fgXMLNSString[];
       static const XMLCh fgXMLNSColonString[];
       static const XMLCh fgXMLNSURIName[];
  
  
  

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