[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization Charact
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization CharacterInfo.cs,1.2,1.3 CompareInfo.cs,1.10,1.11 CultureInfo.cs,1.18,1.19 CultureTypes.cs,1.1,1.2 RegionInfo.cs,1.1,1.2 TextInfo.cs,1.4,1.5 _I18NCompareInfo.cs,1.1,1.2 _I18NCultureHandler.cs,1.2,1.3 _I18NTextInfo.cs,1.1,1.2 |
Date: |
Wed, 16 Apr 2003 02:36:52 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization
In directory subversions:/tmp/cvs-serv16262/runtime/System/Globalization
Modified Files:
CharacterInfo.cs CompareInfo.cs CultureInfo.cs CultureTypes.cs
RegionInfo.cs TextInfo.cs _I18NCompareInfo.cs
_I18NCultureHandler.cs _I18NTextInfo.cs
Log Message:
Remove the bulk of the culture handling if reflection is disabled because there
is no way to load the I18N handlers if reflection is not present.
Index: CharacterInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CharacterInfo.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** CharacterInfo.cs 22 Mar 2002 04:38:06 -0000 1.2
--- CharacterInfo.cs 16 Apr 2003 06:36:50 -0000 1.3
***************
*** 23,26 ****
--- 23,28 ----
{
+ #if !ECMA_COMPAT
+
using System;
using System.Runtime.InteropServices;
***************
*** 145,148 ****
--- 147,152 ----
}; // class CharacterInfo
+
+ #endif // !ECMA_COMPAT
}; // namespace System.Globalization
Index: CompareInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CompareInfo.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** CompareInfo.cs 15 Apr 2003 11:22:32 -0000 1.10
--- CompareInfo.cs 16 Apr 2003 06:36:50 -0000 1.11
***************
*** 63,66 ****
--- 63,67 ----
public static CompareInfo GetCompareInfo(int culture)
{
+ #if CONFIG_REFLECTION
_I18NCultureHandler handler;
CompareInfo info;
***************
*** 76,79 ****
--- 77,81 ----
}
}
+ #endif
// Return the invariant culture information.
***************
*** 86,90 ****
--- 88,96 ----
throw new
ArgumentNullException("culture");
}
+ #if CONFIG_REFLECTION
return
GetCompareInfo(CultureInfo.MapNameToID(culture, true));
+ #else
+ return InvariantCompareInfo;
+ #endif
}
#if CONFIG_REFLECTION
***************
*** 260,263 ****
--- 266,270 ----
}
}
+ #if CONFIG_REFLECTION
if(this is _I18NCompareInfo)
{
***************
*** 268,271 ****
--- 275,279 ----
}
else
+ #endif
{
// Use the invariant comparison method
in the engine.
Index: CultureInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CultureInfo.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** CultureInfo.cs 15 Apr 2003 04:37:44 -0000 1.18
--- CultureInfo.cs 16 Apr 2003 06:36:50 -0000 1.19
***************
*** 27,30 ****
--- 27,33 ----
using System.Text;
+ // Note: if we don't have reflection, then we cannot load I18N handlers,
+ // and all "CultureInfo" objects act like the invariant culture.
+
public class CultureInfo : ICloneable, IFormatProvider
{
***************
*** 32,41 ****
// Cached culture objects.
private static CultureInfo invariantCulture;
private static CultureInfo currentCulture;
private static bool gettingCurrent;
// Internal state.
private int cultureID;
- private CultureName cultureName;
private bool readOnly;
private Calendar calendar;
--- 35,45 ----
// Cached culture objects.
private static CultureInfo invariantCulture;
+ #if CONFIG_REFLECTION
private static CultureInfo currentCulture;
private static bool gettingCurrent;
+ #endif
// Internal state.
private int cultureID;
private bool readOnly;
private Calendar calendar;
***************
*** 46,53 ****
--- 50,60 ----
private TextInfo textInfo;
private bool userOverride;
+ #if CONFIG_REFLECTION
+ private CultureName cultureName;
private _I18NCultureHandler handler;
// Culture identifier for "es-ES" with traditional sort rules.
private const int TraditionalSpanish = 0x040A;
+ #endif
// Constructors.
***************
*** 69,72 ****
--- 76,80 ----
("culture",
_("ArgRange_NonNegative"));
}
+ #if CONFIG_REFLECTION
if(culture == TraditionalSpanish)
{
***************
*** 94,97 ****
--- 102,108 ----
(cultureID, useUserOverride);
}
+ #else
+ cultureID = culture;
+ #endif
userOverride = useUserOverride;
}
***************
*** 102,105 ****
--- 113,117 ----
throw new ArgumentNullException("name");
}
+ #if CONFIG_REFLECTION
cultureName =
CultureNameTable.GetNameInfoByName(name, true);
cultureID = cultureName.cultureID;
***************
*** 107,110 ****
--- 119,126 ----
handler = _I18NCultureHandler.GetCultureHandler
(cultureID, useUserOverride);
+ #else
+ cultureID = 0x007F;
+ userOverride = useUserOverride;
+ #endif
}
***************
*** 127,130 ****
--- 143,148 ----
}
+ #if CONFIG_REFLECTION
+
// Get the current culture identifier from the runtime engine.
[MethodImpl(MethodImplOptions.InternalCall)]
***************
*** 188,191 ****
--- 206,223 ----
}
+ #else // !CONFIG_REFLECTION
+
+ // Get the current culture object for the running thread.
+ public static CultureInfo CurrentCulture
+ {
+ get
+ {
+ // The invariant culture is the only
one in the system.
+ return InvariantCulture;
+ }
+ }
+
+ #endif // !CONFIG_REFLECTION
+
// Get the current UI culture object for the running thread.
public static CultureInfo CurrentUICulture
***************
*** 267,270 ****
--- 299,303 ----
if(calendar == null)
{
+ #if CONFIG_REFLECTION
if(handler != null)
{
***************
*** 276,279 ****
--- 309,313 ----
}
else
+ #endif
{
calendar = new
GregorianCalendar();
***************
*** 294,297 ****
--- 328,332 ----
if(compareInfo == null)
{
+ #if CONFIG_REFLECTION
if(handler != null)
{
***************
*** 304,307 ****
--- 339,343 ----
}
else
+ #endif
{
compareInfo =
CompareInfo.InvariantCompareInfo;
***************
*** 326,329 ****
--- 362,366 ----
return
DateTimeFormatInfo.InvariantInfo;
}
+ #if CONFIG_REFLECTION
else if(handler != null)
{
***************
*** 335,338 ****
--- 372,376 ----
}
else
+ #endif
{
dateTimeFormat = new
DateTimeFormatInfo();
***************
*** 363,366 ****
--- 401,406 ----
}
+ #if CONFIG_REFLECTION
+
// Get the display name for this culture.
public virtual String DisplayName
***************
*** 392,404 ****
}
- // Determine if this culture instance is read-only.
- public virtual bool IsReadOnly
- {
- get
- {
- return readOnly;
- }
- }
-
// Get the culture identifier for this instance.
public virtual int LCID
--- 432,435 ----
***************
*** 428,431 ****
--- 459,485 ----
}
+ #else // !CONFIG_REFLECTION
+
+ // Get the culture name.
+ public virtual String Name
+ {
+ get
+ {
+ // All cultures are invariant if no
reflection.
+ return "";
+ }
+ }
+
+ #endif // !CONFIG_REFLECTION
+
+ // Determine if this culture instance is read-only.
+ public virtual bool IsReadOnly
+ {
+ get
+ {
+ return readOnly;
+ }
+ }
+
// Get or set the number formatting information for this culture.
public virtual NumberFormatInfo NumberFormat
***************
*** 441,444 ****
--- 495,499 ----
return
NumberFormatInfo.InvariantInfo;
}
+ #if CONFIG_REFLECTION
else if(handler != null)
{
***************
*** 450,453 ****
--- 505,509 ----
}
else
+ #endif
{
numberFormat = new
NumberFormatInfo();
***************
*** 487,490 ****
--- 543,547 ----
if(otherCalendars == null)
{
+ #if CONFIG_REFLECTION
if(handler != null)
{
***************
*** 492,495 ****
--- 549,553 ----
}
else
+ #endif
{
otherCalendars
= new Calendar [0];
***************
*** 526,529 ****
--- 584,588 ----
if(textInfo == null)
{
+ #if CONFIG_REFLECTION
if(handler != null)
{
***************
*** 535,538 ****
--- 594,598 ----
}
else
+ #endif
{
textInfo = new
TextInfo(cultureID);
***************
*** 544,547 ****
--- 604,609 ----
}
+ #if CONFIG_REFLECTION
+
// Get the 3-letter ISO language name for this culture.
public virtual String ThreeLetterISOLanguageName
***************
*** 571,574 ****
--- 633,638 ----
}
+ #endif // CONFIG_REFLECTION
+
// Determine if this culture is configured for user overrides.
public virtual bool UseUserOverride
***************
*** 599,602 ****
--- 663,668 ----
}
+ #if CONFIG_REFLECTION
+
// Map a culture name to an identifier.
internal static int MapNameToID(String name, bool throwOnError)
***************
*** 613,616 ****
--- 679,684 ----
}
}
+
+ #endif // CONFIG_REFLECTION
}; // class CultureInfo
Index: CultureTypes.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/CultureTypes.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** CultureTypes.cs 8 Dec 2001 07:42:48 -0000 1.1
--- CultureTypes.cs 16 Apr 2003 06:36:50 -0000 1.2
***************
*** 23,26 ****
--- 23,28 ----
{
+ #if !ECMA_COMPAT
+
using System;
***************
*** 35,38 ****
--- 37,42 ----
}; // enum CultureTypes
+
+ #endif // !ECMA_COMPAT
}; // namespace System.Globalization
Index: RegionInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/RegionInfo.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** RegionInfo.cs 14 Nov 2002 05:55:21 -0000 1.1
--- RegionInfo.cs 16 Apr 2003 06:36:50 -0000 1.2
***************
*** 22,25 ****
--- 22,27 ----
{
+ #if !ECMA_COMPAT
+
using System;
using System.Private;
***************
*** 161,164 ****
--- 163,168 ----
}; // class RegionInfo
+
+ #endif // CONFIG_REFLECTION
}; // namespace System.Globalization
Index: TextInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/TextInfo.cs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** TextInfo.cs 14 Nov 2002 05:01:40 -0000 1.4
--- TextInfo.cs 16 Apr 2003 06:36:50 -0000 1.5
***************
*** 178,182 ****
foreach(char ch in str)
{
! if(CharacterInfo.IsSeparator(ch))
{
wordStart = true;
--- 178,182 ----
foreach(char ch in str)
{
! if(Char.IsSeparator(ch))
{
wordStart = true;
Index: _I18NCompareInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/_I18NCompareInfo.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** _I18NCompareInfo.cs 14 Nov 2002 01:51:19 -0000 1.1
--- _I18NCompareInfo.cs 16 Apr 2003 06:36:50 -0000 1.2
***************
*** 23,26 ****
--- 23,28 ----
{
+ #if CONFIG_REFLECTION
+
// This class exists to allow us to inherit from "CompareInfo" within
// the "I18N" code. It must not be used in application programs. There
***************
*** 45,48 ****
--- 47,52 ----
}; // class _I18NCompareInfo
+
+ #endif // CONFIG_REFLECTION
}; // namespace System.Globalization
Index: _I18NCultureHandler.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/_I18NCultureHandler.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** _I18NCultureHandler.cs 14 Nov 2002 06:10:28 -0000 1.2
--- _I18NCultureHandler.cs 16 Apr 2003 06:36:50 -0000 1.3
***************
*** 23,26 ****
--- 23,28 ----
{
+ #if CONFIG_REFLECTION
+
using System.Text;
***************
*** 106,109 ****
--- 108,113 ----
}; // class _I18NCultureHandler
+
+ #endif // CONFIG_REFLECTION
}; // namespace System.Globalization
Index: _I18NTextInfo.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Globalization/_I18NTextInfo.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** _I18NTextInfo.cs 14 Nov 2002 05:01:41 -0000 1.1
--- _I18NTextInfo.cs 16 Apr 2003 06:36:50 -0000 1.2
***************
*** 23,26 ****
--- 23,28 ----
{
+ #if CONFIG_REFLECTION
+
// This class exists to allow us to inherit from "TextInfo" within
// the "I18N" code. It must not be used in application programs. There
***************
*** 34,37 ****
--- 36,41 ----
}; // class _I18NTextInfo
+
+ #endif // CONFIG_REFLECTION
}; // namespace System.Globalization
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Globalization CharacterInfo.cs,1.2,1.3 CompareInfo.cs,1.10,1.11 CultureInfo.cs,1.18,1.19 CultureTypes.cs,1.1,1.2 RegionInfo.cs,1.1,1.2 TextInfo.cs,1.4,1.5 _I18NCompareInfo.cs,1.1,1.2 _I18NCultureHandler.cs,1.2,1.3 _I18NTextInfo.cs,1.1,1.2,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnet/engine cvm_ptr.c,1.36,1.37 internal.c,1.37,1.38
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.855,1.856
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnet/engine cvm_ptr.c,1.36,1.37 internal.c,1.37,1.38
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnetlib ChangeLog,1.855,1.856
- Index(es):