tango.text.locale.Collation

License:

BSD style: see license.txt

Version:

Initial release: 2005

Author:

John Chapman
class StringComparer [public]
Compares strings using the specified case and cultural comparision rules.
this(Culture culture, bool ignoreCase) [public]
Creates an instance that compares strings using the rules of the specified culture.

Parameters:

cultureA Culture instance whose rules are used to compare strings.
ignoreCasetrue to perform case-insensitive comparisons; false to perform case-sensitive comparisions.
int compare(const(char)[] strA, const(char)[] strB) [public]
Compares two strings and returns the sort order.

Returns:

-1 is strA is less than strB; 0 if strA is equal to strB; 1 if strA is greater than strB.

Parameters:

strAA string to compare to strB.
strBA string to compare to strA.
bool equals(const(char)[] strA, const(char)[] strB) [public]
Indicates whether the two strings are equal.

Returns:

true if strA and strB are equal; otherwise, false.

Parameters:

strAA string to compare to strB.
strBA string to compare to strA.
StringComparer currentCulture() [public, static]
Property. Retrieves an instance that performs case-sensitive comparisons using the rules of the current culture.

Returns:

A new StringComparer instance.
StringComparer currentCultureIgnoreCase() [public, static]
Property. Retrieves an instance that performs case-insensitive comparisons using the rules of the current culture.

Returns:

A new StringComparer instance.
StringComparer invariantCulture() [public, static]
Property. Retrieves an instance that performs case-sensitive comparisons using the rules of the invariant culture.

Returns:

A new StringComparer instance.
StringComparer invariantCultureIgnoreCase() [public, static]
Property. Retrieves an instance that performs case-insensitive comparisons using the rules of the invariant culture.

Returns:

A new StringComparer instance.
alias int delegate(const(char)[], const(char)[]) StringComparison
Delegate. Represents the method that will handle the string comparison.

Remarks:

The delegate has the signature int delegate(const(char)[], const(char)[]).
class StringSorter [public]
Sorts strings according to the rules of the specified culture.
this(StringComparer comparer = null) [public]
Creates an instance using the specified StringComparer.

Parameters:

comparerThe StringComparer to use when comparing strings. Optional.
this(StringComparison comparison) [public]
Creates an instance using the specified delegate.

Parameters:

comparisonThe delegate to use when comparing strings.

Remarks:

The comparison parameter must have the same signature as StringComparison.
inout(void) sort(ref inout(char)[][] array) [public]
Sorts all the elements in an array.

Parameters:

arrayThe array of strings to _sort.
inout(void) sort(ref inout(char)[][] array, size_t index, size_t count) [public]
Sorts a range of the elements in an array.

Parameters:

arrayThe array of strings to _sort.
indexThe starting index of the range.
countThe number of elements in the range.
StringSorter currentCulture() [public, @property, static]
Property. Retrieves an instance that performs a case-sensitive sort using the rules of the current culture.

Returns:

A StringSorter instance.
StringSorter currentCultureIgnoreCase() [public, @property, static]
Property. Retrieves an instance that performs a case-insensitive sort using the rules of the current culture.

Returns:

A StringSorter instance.
StringSorter invariantCulture() [public, static]
Property. Retrieves an instance that performs a case-sensitive sort using the rules of the invariant culture.

Returns:

A StringSorter instance.
StringSorter invariantCultureIgnoreCase() [public, static]
Property. Retrieves an instance that performs a case-insensitive sort using the rules of the invariant culture.

Returns:

A StringSorter instance.