Skip to content

Commit

Permalink
ICU4N.Impl.UCaseProps: Renamed UCaseProperties to conform with .NET c…
Browse files Browse the repository at this point in the history
…onventions (#21)
  • Loading branch information
NightOwl888 committed Oct 10, 2019
1 parent 10fdd2b commit dd708c0
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 118 deletions.
6 changes: 3 additions & 3 deletions src/ICU4N.Transliterator/Text/CaseFoldTransliterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal static void Register()
Transliterator.RegisterSpecialInverse("CaseFold", "Upper", false);
}

private readonly UCaseProps csp;
private readonly UCaseProperties csp;
private ReplaceableContextEnumerator iter;
private StringBuilder result;

Expand All @@ -39,7 +39,7 @@ internal static void Register()
public CaseFoldTransliterator()
: base(_ID, null)
{
csp = UCaseProps.Instance;
csp = UCaseProperties.Instance;
iter = new ReplaceableContextEnumerator();
result = new StringBuilder();
}
Expand Down Expand Up @@ -90,7 +90,7 @@ protected override void HandleTransliterate(IReplaceable text,
/* c mapped to itself, no change */
continue;
}
else if (c <= UCaseProps.MaxStringLength)
else if (c <= UCaseProperties.MaxStringLength)
{
/* replace by the mapping string */
delta = iter.Replace(result.ToString());
Expand Down
8 changes: 4 additions & 4 deletions src/ICU4N.Transliterator/Text/LowercaseTransliterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal static void Register()

private readonly ULocale locale;

private readonly UCaseProps csp;
private readonly UCaseProperties csp;
private ReplaceableContextEnumerator iter;
private StringBuilder result;
private CaseLocale caseLocale;
Expand All @@ -47,10 +47,10 @@ public LowercaseTransliterator(ULocale loc)
: base(_ID, null)
{
locale = loc;
csp = UCaseProps.Instance;
csp = UCaseProperties.Instance;
iter = new ReplaceableContextEnumerator();
result = new StringBuilder();
caseLocale = UCaseProps.GetCaseLocale(locale);
caseLocale = UCaseProperties.GetCaseLocale(locale);
}

/// <summary>
Expand Down Expand Up @@ -99,7 +99,7 @@ protected override void HandleTransliterate(IReplaceable text,
/* c mapped to itself, no change */
continue;
}
else if (c <= UCaseProps.MaxStringLength)
else if (c <= UCaseProperties.MaxStringLength)
{
/* replace by the mapping string */
delta = iter.Replace(result.ToString());
Expand Down
8 changes: 4 additions & 4 deletions src/ICU4N.Transliterator/Text/TitlecaseTransliterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal static void Register()

private readonly ULocale locale;

private readonly UCaseProps csp;
private readonly UCaseProperties csp;
private ReplaceableContextEnumerator iter;
private StringBuilder result;
private CaseLocale caseLocale;
Expand All @@ -46,10 +46,10 @@ public TitlecaseTransliterator(ULocale loc)
locale = loc;
// Need to look back 2 characters in the case of "can't"
MaximumContextLength = 2;
csp = UCaseProps.Instance;
csp = UCaseProperties.Instance;
iter = new ReplaceableContextEnumerator();
result = new StringBuilder();
caseLocale = UCaseProps.GetCaseLocale(locale);
caseLocale = UCaseProperties.GetCaseLocale(locale);
}

/// <summary>
Expand Down Expand Up @@ -147,7 +147,7 @@ protected override void HandleTransliterate(IReplaceable text,
/* c mapped to itself, no change */
continue;
}
else if (c <= UCaseProps.MaxStringLength)
else if (c <= UCaseProperties.MaxStringLength)
{
/* replace by the mapping string */
delta = iter.Replace(result.ToString());
Expand Down
8 changes: 4 additions & 4 deletions src/ICU4N.Transliterator/Text/UppercaseTransliterator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal static void Register()

private readonly ULocale locale;

private readonly UCaseProps csp;
private readonly UCaseProperties csp;
private ReplaceableContextEnumerator iter;
private StringBuilder result;
private CaseLocale caseLocale;
Expand All @@ -42,10 +42,10 @@ public UppercaseTransliterator(ULocale loc)
: base(_ID, null)
{
locale = loc;
csp = UCaseProps.Instance;
csp = UCaseProperties.Instance;
iter = new ReplaceableContextEnumerator();
result = new StringBuilder();
caseLocale = UCaseProps.GetCaseLocale(locale);
caseLocale = UCaseProperties.GetCaseLocale(locale);
}

/// <summary>
Expand Down Expand Up @@ -94,7 +94,7 @@ protected override void HandleTransliterate(IReplaceable text,
/* c mapped to itself, no change */
continue;
}
else if (c <= UCaseProps.MaxStringLength)
else if (c <= UCaseProperties.MaxStringLength)
{
/* replace by the mapping string */
delta = iter.Replace(result.ToString());
Expand Down
14 changes: 7 additions & 7 deletions src/ICU4N/Globalization/UCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3936,7 +3936,7 @@ public static bool IsUpper(string s, int index) // ICU4N specific overload to co
// ICU4N TODO: API - to cover Char, add overload for (string, int)
public static int ToLower(int ch) // ICU4N TODO: API - should this be ToLowerInvariant? Need to figure out the context-sensitive behavior and add overload if necessary.
{
return UCaseProps.Instance.ToLower(ch);
return UCaseProperties.Instance.ToLower(ch);
}

/// <summary>
Expand Down Expand Up @@ -3992,7 +3992,7 @@ public static string ConvertFromUtf32(int utf32) // ICU4N: Renamed from ToString
// ICU4N TODO: API - to cover Char, add overload for (string, int)
public static int ToTitleCase(int ch)
{
return UCaseProps.Instance.ToTitle(ch);
return UCaseProperties.Instance.ToTitle(ch);
}

/// <summary>
Expand All @@ -4018,7 +4018,7 @@ public static int ToTitleCase(int ch)
// ICU4N TODO: API - to cover Char, add overload for (string, int)
public static int ToUpper(int ch) // ICU4N TODO: API - should this be ToUpperInvariant? Need to figure out the context-sensitive behavior and add overload if necessary.
{
return UCaseProps.Instance.ToUpper(ch);
return UCaseProperties.Instance.ToUpper(ch);
}

// ICU4N TODO: API - move functions from above not in System.Char to this section
Expand Down Expand Up @@ -4980,7 +4980,7 @@ public static string ToTitleCase(string str, BreakIterator breakiter) // ICU4N T

private static CaseLocale GetDefaultCaseLocale()
{
return UCaseProps.GetCaseLocale(CultureInfo.CurrentCulture);
return UCaseProperties.GetCaseLocale(CultureInfo.CurrentCulture);
}

private static CaseLocale GetCaseLocale(CultureInfo locale)
Expand All @@ -4989,7 +4989,7 @@ private static CaseLocale GetCaseLocale(CultureInfo locale)
{
locale = CultureInfo.CurrentCulture;
}
return UCaseProps.GetCaseLocale(locale);
return UCaseProperties.GetCaseLocale(locale);
}

private static CaseLocale GetCaseLocale(ULocale locale)
Expand All @@ -4998,7 +4998,7 @@ private static CaseLocale GetCaseLocale(ULocale locale)
{
locale = ULocale.GetDefault();
}
return UCaseProps.GetCaseLocale(locale);
return UCaseProperties.GetCaseLocale(locale);
}

/// <summary>
Expand Down Expand Up @@ -5358,7 +5358,7 @@ public static string FoldCase(string str, bool defaultmapping) // ICU4N TODO: AP
/// <stable>ICU 2.6</stable>
public static int FoldCase(int ch, FoldCase foldCase)
{
return UCaseProps.Instance.Fold(ch, foldCase);
return UCaseProperties.Instance.Fold(ch, foldCase);
}

/// <icu/>
Expand Down
2 changes: 1 addition & 1 deletion src/ICU4N/Impl/CaseMapImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static bool IsLNS(int c)
int gc = UCharacterProperty.Instance.GetType(c);
return ((1 << gc) & LNS) != 0 ||
(gc == UUnicodeCategory.ModifierLetter.ToInt32() &&
UCaseProps.Instance.GetCaseType(c) != CaseType.None);
UCaseProperties.Instance.GetCaseType(c) != CaseType.None);
}

public static int AddTitleIteratorOption(int options, int newOption)
Expand Down
Loading

0 comments on commit dd708c0

Please sign in to comment.