You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2002/04/09 17:44:01 UTC

cvs commit: xml-xerces/c/src/xercesc/util/Transcoders/Win32 Win32TransService.cpp Win32TransService.hpp

knoaman     02/04/09 08:44:01

  Modified:    c/src/xercesc/util TransService.hpp XMLString.cpp
               c/src/xercesc/util/Transcoders/ICU ICUTransService.cpp
                        ICUTransService.hpp
               c/src/xercesc/util/Transcoders/Iconv IconvTransService.cpp
                        IconvTransService.hpp
               c/src/xercesc/util/Transcoders/Iconv390
                        Iconv390TransService.cpp Iconv390TransService.hpp
               c/src/xercesc/util/Transcoders/Iconv400
                        Iconv400TransService.cpp Iconv400TransService.hpp
               c/src/xercesc/util/Transcoders/IconvFBSD
                        IconvFBSDTransService.cpp IconvFBSDTransService.hpp
               c/src/xercesc/util/Transcoders/MacOSUnicodeConverter
                        MacOSUnicodeConverter.cpp MacOSUnicodeConverter.hpp
               c/src/xercesc/util/Transcoders/Win32 Win32TransService.cpp
                        Win32TransService.hpp
  Log:
  Add lower case string support.
  
  Revision  Changes    Path
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/TransService.hpp
  
  Index: TransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/TransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TransService.hpp	1 Feb 2002 22:22:13 -0000	1.1
  +++ TransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: TransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:13  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:13  peiyongz
  + * sane_include
    *
    * Revision 1.14  2001/11/01 23:37:07  jasons
    * 2001-11-01  Jason E. Stewart  <ja...@openinformatics.com>
  @@ -211,6 +214,7 @@
       virtual bool supportsSrcOfs() const = 0;
   
       virtual void upperCase(XMLCh* const toUpperCase) const = 0;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const = 0;
   
   	// -----------------------------------------------------------------------
       //	Allow users to add their own encodings to the intrinsinc mapping
  
  
  
  1.3       +2 -2      xml-xerces/c/src/xercesc/util/XMLString.cpp
  
  Index: XMLString.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLString.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLString.cpp	3 Apr 2002 18:22:36 -0000	1.2
  +++ XMLString.cpp	9 Apr 2002 15:44:00 -0000	1.3
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: XMLString.cpp,v 1.2 2002/04/03 18:22:36 tng Exp $
  + * $Id: XMLString.cpp,v 1.3 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -1459,7 +1459,7 @@
   void XMLString::lowerCase(XMLCh* const toLowerCase)
   {
       // Refer this one to the transcoding service
  -    //XMLPlatformUtils::fgTransService->lowerCase(toLowerCase);
  +    XMLPlatformUtils::fgTransService->lowerCase(toLowerCase);
   }
   
   
  
  
  
  1.2       +11 -1     xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
  
  Index: ICUTransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ICUTransService.cpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ ICUTransService.cpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: ICUTransService.cpp,v 1.1 2002/02/01 22:22:36 peiyongz Exp $
  + * $Id: ICUTransService.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -297,6 +297,16 @@
       while (*outPtr)
       {
           *outPtr = XMLCh(Unicode::toUpperCase(UChar(*outPtr)));
  +        outPtr++;
  +    }
  +}
  +
  +void ICUTransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    XMLCh* outPtr = toLowerCase;
  +    while (*outPtr)
  +    {
  +        *outPtr = XMLCh(Unicode::toLowerCase(UChar(*outPtr)));
           outPtr++;
       }
   }
  
  
  
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
  
  Index: ICUTransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ICUTransService.hpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ ICUTransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: ICUTransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:36  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:36  peiyongz
  + * sane_include
    *
    * Revision 1.10  2000/03/18 00:00:03  roddey
    * Initial updates for two way transcoding support
  @@ -142,6 +145,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   
   protected :
  
  
  
  1.3       +10 -1     xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
  
  Index: IconvTransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IconvTransService.cpp	27 Feb 2002 22:38:52 -0000	1.2
  +++ IconvTransService.cpp	9 Apr 2002 15:44:00 -0000	1.3
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: IconvTransService.cpp,v 1.2 2002/02/27 22:38:52 peiyongz Exp $
  + * $Id: IconvTransService.cpp,v 1.3 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -227,6 +227,15 @@
       }
   }
   
  +void IconvTransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    XMLCh* outPtr = toLowerCase;
  +    while (*outPtr)
  +    {
  +        *outPtr = towlower(*outPtr);
  +        outPtr++;
  +    }
  +}
   
   
   // ---------------------------------------------------------------------------
  
  
  
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp
  
  Index: IconvTransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IconvTransService.hpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ IconvTransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: IconvTransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:36  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:36  peiyongz
  + * sane_include
    *
    * Revision 1.8  2000/03/02 19:55:35  roddey
    * This checkin includes many changes done while waiting for the
  @@ -132,6 +135,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.2       +11 -1     xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
  
  Index: Iconv390TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Iconv390TransService.cpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ Iconv390TransService.cpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: Iconv390TransService.cpp,v 1.1 2002/02/01 22:22:36 peiyongz Exp $
  + * $Id: Iconv390TransService.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -330,6 +330,16 @@
       while (*outPtr != 0) {
   	if ((*outPtr >= 0x61) && (*outPtr <= 0x7A))
   	    *outPtr = *outPtr - 0x20;
  +	outPtr++;
  +    }
  +}
  +
  +void Iconv390TransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    XMLCh* outPtr = toLowerCase;
  +    while (*outPtr != 0) {
  +	if ((*outPtr >= 0x41) && (*outPtr <= 0x5A))
  +	    *outPtr = *outPtr + 0x20;
   	outPtr++;
       }
   }
  
  
  
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.hpp
  
  Index: Iconv390TransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Iconv390TransService.hpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ Iconv390TransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: Iconv390TransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:36  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:36  peiyongz
  + * sane_include
    *
    * Revision 1.3  2000/03/02 19:55:36  roddey
    * This checkin includes many changes done while waiting for the
  @@ -125,6 +128,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.2       +6 -1      xml-xerces/c/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp
  
  Index: Iconv400TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Iconv400TransService.cpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ Iconv400TransService.cpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,7 +56,7 @@
   
   /**
    * @01A D998714.1 V5R2M0    100301   Swan    :Fix error return flags
  - * $Id: Iconv400TransService.cpp,v 1.1 2002/02/01 22:22:36 peiyongz Exp $
  + * $Id: Iconv400TransService.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   // ---------------------------------------------------------------------------
  @@ -243,6 +243,11 @@
           *outPtr = toUnicodeUpper(*outPtr);
           outPtr++;
       }
  +}
  +
  +void Iconv400TransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    //TO DO
   }
   
   // ---------------------------------------------------------------------------
  
  
  
  1.2       +2 -1      xml-xerces/c/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp
  
  Index: Iconv400TransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Iconv400TransService.hpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ Iconv400TransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /**
  - * $Id: Iconv400TransService.hpp,v 1.1 2002/02/01 22:22:36 peiyongz Exp $
  + * $Id: Iconv400TransService.hpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   #ifndef ICONV400TRANSSERVICE_HPP
  @@ -107,6 +107,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   
   protected :
  
  
  
  1.3       +7 -0      xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
  
  Index: IconvFBSDTransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IconvFBSDTransService.cpp	18 Mar 2002 13:39:11 -0000	1.2
  +++ IconvFBSDTransService.cpp	9 Apr 2002 15:44:00 -0000	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: IconvFBSDTransService.cpp,v $
  + * Revision 1.3  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
    * Revision 1.2  2002/03/18 13:39:11  tng
    * [Bug 7162 ] IconvFreeBSDTransService.cpp needs an #include statement fixed to use xercesc.
    *
  @@ -830,6 +833,10 @@
       }
   }
   
  +void IconvFBSDTransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    //TO DO
  +}
   
   // ---------------------------------------------------------------------------
   //  IconvFBSDLCPTranscoder: The virtual transcoder API
  
  
  
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp
  
  Index: IconvFBSDTransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IconvFBSDTransService.hpp	1 Feb 2002 22:22:36 -0000	1.1
  +++ IconvFBSDTransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: IconvFBSDTransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:36  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:36  peiyongz
  + * sane_include
    *
    * Revision 1.3  2002/01/14 19:45:15  tng
    * Support IconvFBSD in multi-threading environment with all the possible combinations of threading and transcoding options.  By Max Gotlib.
  @@ -237,6 +240,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toUpperCase) const;
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.2       +31 -1     xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
  
  Index: MacOSUnicodeConverter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MacOSUnicodeConverter.cpp	1 Feb 2002 22:22:37 -0000	1.1
  +++ MacOSUnicodeConverter.cpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - *	$Id: MacOSUnicodeConverter.cpp,v 1.1 2002/02/01 22:22:37 peiyongz Exp $
  + *	$Id: MacOSUnicodeConverter.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -489,6 +489,36 @@
   	}
   #else
   	#error Sorry, no support for upperCase
  +#endif
  +}
  +
  +void MacOSUnicodeConverter::lowerCase(XMLCh* const toLowerCase) const
  +{
  +	//	��� TODO: Support CFString for this conversion
  +#if defined(XML_METROWERKS)
  +	// Use this if there's a reasonable c library available.
  +	// Metrowerks does this reasonably
  +	wchar_t * p = (wchar_t*) toLowerCase;
  +	wchar_t c;
  +	
  +	while ((c = *p) != 0)
  +		*p++ = std::towlower(c);
  +#elif defined(XML_MACOSX) || true
  +	// This might work, assuming we're on an ascii compiler.
  +	// We'll use this under ProjectBuilder for now.
  +	// Note that this only handles the ascii portion of the
  +	// string, leaving all other characters in original case.
  +	wchar_t * p = (wchar_t*)toLowerCase;
  +	wchar_t c;
  +	
  +	while ((c = *p) != 0)
  +	{
  +		if (c >= 'A' && c <= 'Z')
  +			c += 'a' - 'A';
  +		*p++ = c;
  +	}
  +#else
  +	#error Sorry, no support for lowerCase
   #endif
   }
   
  
  
  
  1.2       +2 -2      xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
  
  Index: MacOSUnicodeConverter.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MacOSUnicodeConverter.hpp	1 Feb 2002 22:22:37 -0000	1.1
  +++ MacOSUnicodeConverter.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: MacOSUnicodeConverter.hpp,v 1.1 2002/02/01 22:22:37 peiyongz Exp $
  + * $Id: MacOSUnicodeConverter.hpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   #ifndef MACOSUNICODECONVERTER_HPP
  @@ -111,7 +111,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  -
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   protected :
       // -----------------------------------------------------------------------
  
  
  
  1.2       +5 -1      xml-xerces/c/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
  
  Index: Win32TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Win32TransService.cpp	1 Feb 2002 22:22:37 -0000	1.1
  +++ Win32TransService.cpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: Win32TransService.cpp,v 1.1 2002/02/01 22:22:37 peiyongz Exp $
  + * $Id: Win32TransService.cpp,v 1.2 2002/04/09 15:44:00 knoaman Exp $
    */
   
   
  @@ -489,6 +489,10 @@
       _wcsupr(toUpperCase);
   }
   
  +void Win32TransService::lowerCase(XMLCh* const toLowerCase) const
  +{
  +    _wcslwr(toLowerCase);
  +}
   
   bool Win32TransService::isAlias(const   HKEY            encodingKey
                       ,       char* const     aliasBuf 
  
  
  
  1.2       +4 -0      xml-xerces/c/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
  
  Index: Win32TransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Win32TransService.hpp	1 Feb 2002 22:22:37 -0000	1.1
  +++ Win32TransService.hpp	9 Apr 2002 15:44:00 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: Win32TransService.hpp,v $
  - * Revision 1.1  2002/02/01 22:22:37  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/04/09 15:44:00  knoaman
  + * Add lower case string support.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:37  peiyongz
  + * sane_include
    *
    * Revision 1.10  2000/05/09 00:22:45  andyh
    * Memory Cleanup.  XMLPlatformUtils::Terminate() deletes all lazily
  @@ -154,6 +157,7 @@
       virtual bool supportsSrcOfs() const;
   
       virtual void upperCase(XMLCh* const toUpperCase) const;
  +    virtual void lowerCase(XMLCh* const toLowerCase) const;
   
   
   protected :
  
  
  

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