Represents a string comparison operation that uses specific case and culture-based or ordinal comparison rules.
Public Static Properties | |
| static auto | current_culture () -> basic_string_comparer |
| Gets a xtd::basic_string_comparer object that performs a case-sensitive string comparison using the word comparison rules of the current culture. | |
| static auto | current_culture_ignore_case () -> basic_string_comparer |
| Gets a xtd::basic_string_comparer object that performs case-insensitive string comparisons using the word comparison rules of the current culture. | |
| static auto | invariant_culture () -> basic_string_comparer |
| static auto | invariant_culture_ignore_case () -> basic_string_comparer |
| static auto | ordinal () -> const basic_string_comparer & |
| Gets a xtd::basic_string_comparer object that performs a case-sensitive ordinal string comparison. | |
| static auto | ordinal_ignore_case () -> const basic_string_comparer & |
| Gets a xtd::basic_string_comparer object that performs a case-insensitive ordinal string comparison. | |
Public Static Methods | |
| static auto | from_comparison (xtd::string_comparison comparisoncomparison) -> basic_string_comparer |
| Converts the specified xtd::string_comparison instance to a StringComparer instance. | |
| static auto | is_well_known_ordinal_comparer (const xtd::collections::generic::iequality_comparer< xtd::basic_string< char_t > > &comparer, bool &ignore_case) -> bool |
| Determines whether the specified xtd::collections::generic::iequality_comparer <type_t> is a well-known ordinal string comparer. | |
Public Methods | |
| template<typename object_t> | |
| auto | compare (const object_t &x, const object_t &y) const -> xtd::int32 |
| When overridden in a derived class, compares two objects and returns an indication of their relative sort order. | |
| auto | compare (const xtd::basic_string< char_t > &x, const xtd::basic_string< char_t > &y) const noexcept -> xtd::int32 override |
| When overridden in a derived class, compares two strings and returns an indication of their relative sort order. | |
| auto | equals (const object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| template<typename object_t> | |
| auto | equals (const object_t &x, const object_t &y) const -> bool |
| When overridden in a derived class, indicates whether two objects are equal. | |
| auto | equals (const xtd::basic_string< char_t > &x, const xtd::basic_string< char_t > &y) const noexcept -> bool override |
| When overridden in a derived class, indicates whether two strings are equal. | |
| template<typename object_t> | |
| auto | get_hash_code (const object_t &obj) const -> xtd::usize |
| When overridden in a derived class, gets the hash code for the specified object. | |
| auto | get_hash_code (const xtd::basic_string< char_t > &obj) const noexcept -> xtd::usize override |
| When overridden in a derived class, gets the hash code for the specified string. | |
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| Serves as a hash function for a particular type. | |
Protected Constructors | |
| basic_string_comparer ()=default | |
| Initializes a new instance of the xtd::basic_string_comparer class. | |
Additional Inherited Members | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
|
protecteddefault |
Initializes a new instance of the xtd::basic_string_comparer class.
|
inlinestaticnodiscard |
Gets a xtd::basic_string_comparer object that performs a case-sensitive string comparison using the word comparison rules of the current culture.
|
inlinestaticnodiscard |
Gets a xtd::basic_string_comparer object that performs case-insensitive string comparisons using the word comparison rules of the current culture.
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
Gets a xtd::basic_string_comparer object that performs a case-sensitive ordinal string comparison.
|
inlinestaticnodiscard |
Gets a xtd::basic_string_comparer object that performs a case-insensitive ordinal string comparison.
|
inlinenodiscard |
When overridden in a derived class, compares two objects and returns an indication of their relative sort order.
| x | An object to compare to y. |
| y | An object to compare to x. |
| Value | Meaning |
|---|---|
| Less than zero | x precedes y in the sort order. |
| Zero | x is equal to y. |
| Greater than zero | x follows y in the sort order. |
| xtd::argument_exception | Neither `x` nor `y` is a xtd::string object, and neither `x` nor `y` implements the `xtd::icomparable` interface. |
|
inlinenodiscardoverridevirtualnoexcept |
When overridden in a derived class, compares two strings and returns an indication of their relative sort order.
| x | An object to compare to y. |
| y | An object to compare to x. |
| Value | Meaning |
|---|---|
| Less than zero | x precedes y in the sort order. |
| Zero | x is equal to y. |
| Greater than zero | x follows y in the sort order. |
Implements xtd::collections::generic::icomparer< xtd::basic_string< char_t > >.
|
inlinenodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
inlinenodiscard |
When overridden in a derived class, indicates whether two objects are equal.
| x | An object to compare to y. |
| y | An object to compare to x. |
|
inlinenodiscardoverridevirtualnoexcept |
When overridden in a derived class, indicates whether two strings are equal.
| x | An object to compare to y. |
| y | An object to compare to x. |
Implements xtd::collections::generic::iequality_comparer< xtd::basic_string< char_t > >.
|
inlinenodiscard |
When overridden in a derived class, gets the hash code for the specified object.
| obj | An object. |
|
inlinenodiscardoverridevirtualnoexcept |
When overridden in a derived class, gets the hash code for the specified string.
| obj | A string. |
Implements xtd::collections::generic::iequality_comparer< xtd::basic_string< char_t > >.
|
inlinestaticnodiscard |
Converts the specified xtd::string_comparison instance to a StringComparer instance.
| comparison | A string comparer instance to convert. |
| xtd::argument_exception | The specified string comparison is not supported. |
|
inlinestaticnodiscard |
Determines whether the specified xtd::collections::generic::iequality_comparer <type_t> is a well-known ordinal string comparer.
| comparer | The comparer to query. |
| ignore_case | When this method returns, contains a value stating whether comparer is case-insensitive. Set to false if this method returns false. |
|
nodiscardvirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.