CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
sort_key.h
1
2#pragma once
3
4#include <system/object.h>
5#include <system/string.h>
6#include <system/array.h>
7#include <system/globalization/compare_options.h>
8
9namespace System { namespace Globalization {
10
11class SortKey;
14
19class ASPOSECPP_SHARED_CLASS SortKey : public Object
20{
22 RTTI_INFO(System::Globalization::SortKey, ::System::BaseTypesInfo<System::Object>)
23
24
29 ASPOSECPP_SHARED_API SortKey(const String& locale_name, const String& str, CompareOptions options, const ByteArrayPtr& key_data);
30
31public:
32 SortKey(const SortKey&) = delete;
33 SortKey& operator=(const SortKey&) = delete;
34
37 virtual ASPOSECPP_SHARED_API String get_OriginalString();
40 virtual ASPOSECPP_SHARED_API ArrayPtr<uint8_t> get_KeyData();
41
46 static ASPOSECPP_SHARED_API int Compare(const SortKeyPtr& sortkey1, const SortKeyPtr& sortkey2);
47
48 // Object methods
52 ASPOSECPP_SHARED_API bool Equals(SharedPtr<Object> value) override;
55 ASPOSECPP_SHARED_API int GetHashCode() const override;
58 ASPOSECPP_SHARED_API String ToString() const override;
59
60private:
62 const String m_locale_name;
64 const String m_original_string;
66 const CompareOptions m_compare_options;
68 const ByteArrayPtr m_key_data;
69
71 static int Compare(const SortKey& sortkey1, const SortKey& sortkey2);
72};
73
74}} // namespace System::Globalization
Mapping of a string to its sort key. Objects of this class should only be allocated using System::Mak...
Definition: sort_key.h:20
SortKey & operator=(const SortKey &)=delete
virtual ArrayPtr< uint8_t > get_KeyData()
Gets byte array representing current object.
SortKey(const SortKey &)=delete
int GetHashCode() const override
Gets hash code for the current SortKey object.
bool Equals(SharedPtr< Object > value) override
Checks if the specified object is equal to the current SortKey object.
String ToString() const override
Converts current object to its string representation.
virtual String get_OriginalString()
Gets original string used to create this object.
static int Compare(const SortKeyPtr &sortkey1, const SortKeyPtr &sortkey2)
Compares two sort keys.
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
SharedPtr< SortKey > SortKeyPtr
SortKey pointer type.
Definition: sort_key.h:13
CompareOptions
String comparison options.
Definition: compare_options.h:12
Definition: db_command.h:9
std::enable_if_t<!std::is_floating_point< TA >::value &&!std::is_floating_point< TB >::value, int > Compare(const TA &a, const TB &b)
Compares two values.
Definition: primitive_types.h:113