CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
string_info.h
1
2#pragma once
3
4#include <system/array.h>
5#include <system/globalization/text_element_enumerator.h>
6
7namespace System { namespace Globalization {
8
9class StringInfo;
12
17class ASPOSECPP_SHARED_CLASS StringInfo : public virtual Object
18{
20 RTTI_INFO(System::Globalization::StringInfo, ::System::BaseTypesInfo<System::Object>)
21
22public:
24 ASPOSECPP_SHARED_API StringInfo();
27 ASPOSECPP_SHARED_API StringInfo(const String& value);
28
29 StringInfo(const StringInfo&) = delete;
30 StringInfo& operator=(const StringInfo&) = delete;
31
34 ASPOSECPP_SHARED_API String get_String() const;
37 ASPOSECPP_SHARED_API void set_String(const String& value);
39 ASPOSECPP_SHARED_API int get_LengthInTextElements() const;
40
44 ASPOSECPP_SHARED_API String SubstringByTextElements(int starting_text_element) const;
49 ASPOSECPP_SHARED_API String SubstringByTextElements(int starting_text_element, int length_in_text_elements) const;
50
51 // Object methods
52 ASPOSECPP_SHARED_API bool Equals(SharedPtr<Object> value) override;
53 ASPOSECPP_SHARED_API int GetHashCode() const override;
54
58 static ASPOSECPP_SHARED_API String GetNextTextElement(const String& str);
63 static ASPOSECPP_SHARED_API String GetNextTextElement(const String& str, int index);
67 static ASPOSECPP_SHARED_API SharedPtr<TextElementEnumerator> GetTextElementEnumerator(const String& str);
72 static ASPOSECPP_SHARED_API SharedPtr<TextElementEnumerator> GetTextElementEnumerator(const String& str, int index);
76 static ASPOSECPP_SHARED_API ArrayPtr<int> ParseCombiningCharacters(const String& str);
77
78private:
80 String m_value;
81 mutable ArrayPtr<int> m_indexes;
82
83 ArrayPtr<int>& Indexes() const;
84};
85
86}} // System::Globalization
Splitter to iterate through string parts. Objects of this class should only be allocated using System...
Definition: string_info.h:18
String SubstringByTextElements(int starting_text_element, int length_in_text_elements) const
Gets substring of text elements from the specified text element through the specified number of text ...
String SubstringByTextElements(int starting_text_element) const
Gets substring of text elements from the specified text element through the last text element.
int get_LengthInTextElements() const
Gets number of text items in StringInfo object.
bool Equals(SharedPtr< Object > value) override
void set_String(const String &value)
Sets the value of the StringInfo object.
StringInfo & operator=(const StringInfo &)=delete
StringInfo(const StringInfo &)=delete
static ArrayPtr< int > ParseCombiningCharacters(const String &str)
Gets indexes of the base characters, high surrogates and control characters.
static SharedPtr< TextElementEnumerator > GetTextElementEnumerator(const String &str, int index)
Creates enumerator to iterate through string's characters starting at the specified index.
static String GetNextTextElement(const String &str, int index)
Gets element at the specified index of the specified string.
String get_String() const
Gets the value of the StringInfo object.
int GetHashCode() const override
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
static String GetNextTextElement(const String &str)
Gets first element in the specified string.
static SharedPtr< TextElementEnumerator > GetTextElementEnumerator(const String &str)
Creates enumerator to iterate through string's characters.
StringInfo(const String &value)
Constructor.
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< StringInfo > StringInfoPtr
StringInfo pointer type.
Definition: string_info.h:11
Definition: db_command.h:9