You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/12/07 19:58:26 UTC

cvs commit: xml-xalan/c/src/ICUBridge ICUBridge.cpp ICUBridge.hpp ICUBridgeCollationCompareFunctor.cpp ICUBridgeCollationCompareFunctor.hpp ICUXalanNumberFormatProxy.cpp ICUXalanNumberFormatProxy.hpp

dbertoni    01/12/07 10:58:26

  Modified:    c/src/ICUBridge ICUBridge.cpp ICUBridge.hpp
                        ICUBridgeCollationCompareFunctor.cpp
                        ICUBridgeCollationCompareFunctor.hpp
                        ICUXalanNumberFormatProxy.cpp
                        ICUXalanNumberFormatProxy.hpp
  Log:
  Fixes for ICU 2.0.
  
  Revision  Changes    Path
  1.13      +28 -30    xml-xalan/c/src/ICUBridge/ICUBridge.cpp
  
  Index: ICUBridge.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridge.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ICUBridge.cpp	2001/02/12 19:35:27	1.12
  +++ ICUBridge.cpp	2001/12/07 18:58:25	1.13
  @@ -113,12 +113,12 @@
   
   
   
  -const UnicodeString
  +const ICUBridge::ICUUnicodeString
   ICUBridge::XalanDOMCharStringToUnicodeString(const XalanDOMChar*	theString)
   {
   	if (theString == 0)
   	{
  -		return UnicodeString();
  +		return ICUUnicodeString();
   	}
   	else
   	{
  @@ -133,14 +133,14 @@
   			doCopyData(theString, theLength, theBuffer);
   
   #if U_SIZEOF_WCHAR_T==2
  -			return UnicodeString((wchar_t*)&theBuffer[0], theLength);
  +			return ICUUnicodeString((wchar_t*)&theBuffer[0], theLength);
   #else
  -			return UnicodeString(&theBuffer[0], theLength);
  +			return ICUUnicodeString(&theBuffer[0], theLength);
   #endif
   		}
   		else
   		{
  -			// Create a buffer to copy out the UnicodeString data...
  +			// Create a buffer to copy out the ICUUnicodeString data...
   			UCharVectorType		theBuffer;
   
   			// Resize the buffer appropriately...
  @@ -154,17 +154,17 @@
   
   			assert(theLength == theBuffer.size());
   
  -			return UnicodeString(&theBuffer[0], theLength);
  +			return ICUUnicodeString(&theBuffer[0], theLength);
   		}
   #else
  -		return UnicodeString(theString, length(theString));
  +		return ICUUnicodeString(theString, length(theString));
   #endif
   	}
   }
   
   
   
  -const UnicodeString
  +const ICUBridge::ICUUnicodeString
   ICUBridge::XalanDOMStringToUnicodeString(const XalanDOMString&	theString)
   {
   	// Just call up to the XalanDOMChar* version...
  @@ -174,7 +174,7 @@
   
   
   const XalanDOMString
  -ICUBridge::UnicodeStringToXalanDOMString(const UnicodeString&	theString)
  +ICUBridge::UnicodeStringToXalanDOMString(const ICUUnicodeString&	theString)
   {
   	const int32_t	theLength = theString.length();
   
  @@ -208,7 +208,7 @@
   	}
   	else
   	{
  -		// Create a buffer to copy out the UnicodeString data...
  +		// Create a buffer to copy out the ICUUnicodeString data...
   		UCharVectorType		theBuffer;
   
   		// Resize the buffer appropriately...
  @@ -228,8 +228,8 @@
   
   void
   ICUBridge::UnicodeStringToXalanDOMString(
  -			const UnicodeString&	theString,
  -			XalanDOMString&			theResult)
  +			const ICUUnicodeString&		theString,
  +			XalanDOMString&				theResult)
   {
   #if defined(XALAN_XALANDOMCHAR_USHORT_MISMATCH)
   	
  @@ -260,7 +260,7 @@
   		typedef std::vector<UChar>	UCharVectorType;
   #endif
   
  -		// Create a buffer to copy out the UnicodeString data...
  +		// Create a buffer to copy out the ICUUnicodeString data...
   		UCharVectorType		theBuffer;
   
   		// Resize the buffer appropriately...
  @@ -292,24 +292,22 @@
   
   		// We got a XalanDecimalFormatSymbols, so set the
   		// corresponding data in the ICU DecimalFormatSymbols.
  -		theDFS->setZeroDigit(theXalanDFS.getZeroDigit());
  -		theDFS->setGroupingSeparator(theXalanDFS.getGroupingSeparator());
  -		theDFS->setDecimalSeparator(theXalanDFS.getDecimalSeparator());
  -		theDFS->setPerMill(theXalanDFS.getPerMill());
  -		theDFS->setPercent(theXalanDFS.getPercent());
  -		theDFS->setDigit(theXalanDFS.getDigit());
  -		theDFS->setPatternSeparator(theXalanDFS.getPatternSeparator());
  -
  -		theDFS->setInfinity(ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getInfinity()));
  -		theDFS->setNaN(ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getNaN()));
  -	//	theDFS->setPlusSign(theZeroDigitChar);
  -		theDFS->setMinusSign(theXalanDFS.getMinusSign());
  -	//	theDFS->setExponentialSymbol(theZeroDigitChar);
  -		theDFS->setCurrencySymbol(ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getCurrencySymbol()));
  -		theDFS->setInternationalCurrencySymbol(ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getInternationalCurrencySymbol()));
  -		theDFS->setMonetaryDecimalSeparator(theXalanDFS.getMonetaryDecimalSeparator());
  +		theDFS->setSymbol(DecimalFormatSymbols::kZeroDigitSymbol, theXalanDFS.getZeroDigit());
  +		theDFS->setSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol, theXalanDFS.getGroupingSeparator());
  +		theDFS->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, theXalanDFS.getDecimalSeparator());
  +		theDFS->setSymbol(DecimalFormatSymbols::kPerMillSymbol, theXalanDFS.getPerMill());
  +		theDFS->setSymbol(DecimalFormatSymbols::kPercentSymbol, theXalanDFS.getPercent());
  +		theDFS->setSymbol(DecimalFormatSymbols::kDigitSymbol, theXalanDFS.getDigit());
  +		theDFS->setSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol, theXalanDFS.getPatternSeparator());
  +
  +		theDFS->setSymbol(DecimalFormatSymbols::kInfinitySymbol, ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getInfinity()));
  +		theDFS->setSymbol(DecimalFormatSymbols::kNaNSymbol, ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getNaN()));
  +		theDFS->setSymbol(DecimalFormatSymbols::kMinusSignSymbol, theXalanDFS.getMinusSign());
  +		theDFS->setSymbol(DecimalFormatSymbols::kCurrencySymbol, ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getCurrencySymbol()));
  +		theDFS->setSymbol(DecimalFormatSymbols::kIntlCurrencySymbol, ICUBridge::XalanDOMStringToUnicodeString(theXalanDFS.getInternationalCurrencySymbol()));
  +		theDFS->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, theXalanDFS.getMonetaryDecimalSeparator());
   
  -		UnicodeString	theUnicodeResult;
  +		ICUBridge::ICUUnicodeString		theUnicodeResult;
   
   		// Construct a DecimalFormat.  Note that we release the XalanAutoPtr, since the
   		// DecimalFormat will adopt the DecimalFormatSymbols instance.
  
  
  
  1.4       +28 -5     xml-xalan/c/src/ICUBridge/ICUBridge.hpp
  
  Index: ICUBridge.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridge.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ICUBridge.hpp	2000/07/12 21:45:39	1.3
  +++ ICUBridge.hpp	2001/12/07 18:58:25	1.4
  @@ -72,7 +72,24 @@
   
   
   
  +// We're stuck here.  We don't want to include the ICU header files, since we're trying
  +// to keep them hidden, but we need their namespace.  So we're just duplicating here.  When
  +// it changes, we'll have to track that change.  This is more desirable than forcing users
  +// to have the ICU sources.
  +//
  +// We could fix this by using factories, rather than allowing user access to these
  +// implementation classes.  It's certainly worth pursuing...
  +#if defined(XALAN_NO_NAMESPACES)
   class UnicodeString;
  +#else
  +namespace icu_2_0
  +{
  +	class UnicodeString;
  +};
  +#endif
  +
  +
  +
   class XalanDecimalFormatSymbols;
   
   
  @@ -80,20 +97,26 @@
   class XALAN_ICUBRIDGE_EXPORT ICUBridge
   {
   public:
  +
  +#if defined(XALAN_NO_NAMESPACES)
  +	typedef UnicodeString			ICUUnicodeString;
  +#else
  +	typedef icu_2_0::UnicodeString	ICUUnicodeString;
  +#endif
   
  -	static const UnicodeString
  +	static const ICUUnicodeString
   	XalanDOMCharStringToUnicodeString(const XalanDOMChar*	theString);
   
  -	static const UnicodeString
  +	static const ICUUnicodeString
   	XalanDOMStringToUnicodeString(const XalanDOMString&		theString);
   
   	static const XalanDOMString
  -	UnicodeStringToXalanDOMString(const UnicodeString&	theString);
  +	UnicodeStringToXalanDOMString(const ICUUnicodeString&	theString);
   
   	static void
   	UnicodeStringToXalanDOMString(
  -			const UnicodeString&	theString,
  -			XalanDOMString&			theResult);
  +			const ICUUnicodeString&		theString,
  +			XalanDOMString&				theResult);
   
   	static unsigned long
   	FormatNumber(
  
  
  
  1.19      +3 -0      xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp
  
  Index: ICUBridgeCollationCompareFunctor.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.cpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- ICUBridgeCollationCompareFunctor.cpp	2001/09/26 20:40:30	1.18
  +++ ICUBridgeCollationCompareFunctor.cpp	2001/12/07 18:58:25	1.19
  @@ -70,6 +70,9 @@
   
   #include <unicode/coll.h>
   
  +// this is the ICU's macro for using namespace ...
  +U_NAMESPACE_USE
  +
   
   
   const StylesheetExecutionContextDefault::DefaultCollationCompareFunctor		ICUBridgeCollationCompareFunctor::s_defaultFunctor;
  
  
  
  1.7       +19 -1     xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.hpp
  
  Index: ICUBridgeCollationCompareFunctor.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUBridgeCollationCompareFunctor.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ICUBridgeCollationCompareFunctor.hpp	2001/08/20 22:10:29	1.6
  +++ ICUBridgeCollationCompareFunctor.hpp	2001/12/07 18:58:25	1.7
  @@ -68,7 +68,21 @@
   
   
   
  +// We're stuck here.  We don't want to include the ICU header files, since we're trying
  +// to keep them hidden, but we need their namespace.  So we're just duplicating here.  When
  +// it changes, we'll have to track that change.  This is more desirable than forcing users
  +// to have the ICU sources.
  +//
  +// We could fix this by using factories, rather than allowing user access to these
  +// implementation classes.  It's certainly worth pursuing...
  +#if defined(XALAN_NO_NAMESPACES)
   class Collator;
  +#else
  +namespace icu_2_0
  +{
  +	class Collator;
  +};
  +#endif
   
   
   
  @@ -107,7 +121,11 @@
   
   	bool		m_isValid;
   
  -	Collator*	m_defaultCollator;
  +#if defined(XALAN_NO_NAMESPACES)
  +	Collator*			m_defaultCollator;
  +#else
  +	icu_2_0::Collator*	m_defaultCollator;
  +#endif
   
   	const static StylesheetExecutionContextDefault::DefaultCollationCompareFunctor		s_defaultFunctor;
   };
  
  
  
  1.8       +6 -1      xml-xalan/c/src/ICUBridge/ICUXalanNumberFormatProxy.cpp
  
  Index: ICUXalanNumberFormatProxy.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUXalanNumberFormatProxy.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ICUXalanNumberFormatProxy.cpp	2001/06/15 22:10:34	1.7
  +++ ICUXalanNumberFormatProxy.cpp	2001/12/07 18:58:25	1.8
  @@ -66,8 +66,11 @@
   #include <unicode/dcfmtsym.h>
   #include <unicode/decimfmt.h>
   
  +// this is the ICU's macro for using namespace ...
  +U_NAMESPACE_USE
   
   
  +
   #include <PlatformSupport/DOMStringHelper.hpp>
   
   
  @@ -258,7 +261,9 @@
   	DecimalFormatSymbols* const		theNewSymbols =
   		new DecimalFormatSymbols(*theCurrentSymbols);
   
  -	theNewSymbols->setGroupingSeparator(charAt(s, 0));
  +	theNewSymbols->setSymbol(
  +		DecimalFormatSymbols::kGroupingSeparatorSymbol,
  +		ICUBridge::XalanDOMStringToUnicodeString(s));
   
   	m_decimalFormat->adoptDecimalFormatSymbols(theNewSymbols);
   }
  
  
  
  1.3       +19 -1     xml-xalan/c/src/ICUBridge/ICUXalanNumberFormatProxy.hpp
  
  Index: ICUXalanNumberFormatProxy.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/ICUBridge/ICUXalanNumberFormatProxy.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ICUXalanNumberFormatProxy.hpp	2001/06/14 19:04:37	1.2
  +++ ICUXalanNumberFormatProxy.hpp	2001/12/07 18:58:25	1.3
  @@ -68,7 +68,21 @@
   
   
   
  +// We're stuck here.  We don't want to include the ICU header files, since we're trying
  +// to keep them hidden, but we need their namespace.  So we're just duplicating here.  When
  +// it changes, we'll have to track that change.  This is more desirable than forcing users
  +// to have the ICU sources.
  +//
  +// We could fix this by using factories, rather than allowing user access to these
  +// implementation classes.  It's certainly worth pursuing...
  +#if defined(XALAN_NO_NAMESPACES)
   class DecimalFormat;
  +#else
  +namespace icu_2_0
  +{
  +	class DecimalFormat;
  +};
  +#endif
   
   
   
  @@ -138,7 +152,11 @@
   
   private:
   
  -	DecimalFormat*	m_decimalFormat;
  +#if defined(XALAN_NO_NAMESPACES)
  +	DecimalFormat*				m_decimalFormat;
  +#else
  +	icu_2_0::DecimalFormat*		m_decimalFormat;
  +#endif
   };
   
   
  
  
  

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