
Public Member Functions | |
| override string | ToString () |
| wxString (string str) | |
| wxString () | |
| wxString (IntPtr wxObject) | |
Static Public Member Functions | |
| static implicit | operator string (wxString str) |
| static wxString | SafeNew (IntPtr ptrToStr, bool memOwn) |
| static wxString | SafeNew (IntPtr ptrToStr) |
| static wxString | SafeNew (string str) |
Protected Member Functions | |
| override void | CallDTor () |
Properties | |
| int | Length [get] |
| char | this [int n] [get] |
wxString.Objectives:
wx.NET implementations interchange string data with the used wxWidgets library. Conversion from .NET strings to wxWidgets strings shall be hidden. .NET implementations shall be able to use something like a lazy conversion: Simply getting a string from one method of wxWidgets and sending it to another shall be possible without conversion to .NET strings. wx.NET implementation.wx-c side) to convert from or to this encoding. So, the interface provided by wx-c is always UTF 16 whether the library is able to represent such strings internally or not. An MarshalAsAttribute is used to define a more verbatim marshalling scheme on DLL import.So, any kind of conversion is done by wxWidgets (if necessary) and not by the .NET framework.
Refer to wxWCharBuffer and DisposableStringBox for remarks on helper classes for dealing with strings.
| wx.wxString.wxString | ( | IntPtr | wxObject | ) |
| wx.wxString.wxString | ( | ) |
| wx.wxString.wxString | ( | string | str | ) |
| override void wx.wxString.CallDTor | ( | ) | [protected, virtual] |
| static implicit wx.wxString.operator string | ( | wxString | str | ) | [static] |
| static wxString wx.wxString.SafeNew | ( | IntPtr | ptrToStr, | |
| bool | memOwn | |||
| ) | [static] |
| static wxString wx.wxString.SafeNew | ( | IntPtr | ptrToStr | ) | [static] |
| static wxString wx.wxString.SafeNew | ( | string | str | ) | [static] |
This will safely create an instance of wx.wxString without throwing exceptions on argument null. Instead the method will return result null on argument null.
| override string wx.wxString.ToString | ( | ) |
Conversion of wxString into a string. This method works different on Unicode- and ANSI-builds of wxWidgets. On Unicode builds we can directly refer to the internal buffer using the indexer of this class. Otherwise we read a wxWCharBuffer and convert this.
Special case: PNET with internal UTF8 character encoding if WXNET_INTERNAL_USE_UTF8. In this case, we always have to decode.
int wx.wxString.Length [get] |
Returns the length of the encapsulated string.
| char wx.wxString.this[int n] | ( | ) | [get] |
Get the n-th character. Returns a 2 byte UTF16 character. Only get implemented. Undefined positions will result in a 0. This works perfect on a Unicode build (ReflectConfig.CheckUseUnicode) since internal characer encoding of wxString is the same as the encoding in C#. On ANSI builds this will return blanks as replacemetns of non-ascii characters.
Correction: Microsoft and Mono use UTF16 as internal string representation just like wxWidgets with wide character Unicode support compiled in. However, PNET seems to use UTF 8 instead. If this assumes internal UTF 8 strings, this method will return ASCII only.