MEng.Char represents a single character. Note that the CML language is Unicode based, so a character is a Unicode code point, not ASCII or Latin1 or other code page you might be used to using. The low 127 code points of Unicode are basically the same as ASCII, but it represents a far larger set of characters than ASCII.
CML uses the UTF-16 format for Unicode characters internally under Windows, and doesn't really do anything special to deal with surrogate pairs, so it might not do the right thing if you pull in any text that causes surrogate pairs to be created. For instance, the length of the string is the number of UTF-16 items in the string, so if a single character is represented by a surrogate pair, the length will be one more than the actual characters represented in the string. This is unlikely to be of much concern in general, but it is something to keep in mind.
Information about Unicode is available at: http://www.unicode.org/.
Literals:
kBOM(0xFEFF);
kCR(0x0D);
kEsc(0x1B);
kFF(0x0C);
kLF(0x0A);
kHTab(0x09);
kSwappedBOM(0xFFFE);
These literals provide convenient versions of commonly used special characters. The BOM is the Byte Order Mark that is often used in UTF-16 formatted content to indicate the endianness of the data. It will often be maintained when encoded as UTF-8, though not required, which indicates the endianness of the original content before encoding.
Nested Classes:
Enum=CharTypes
ASCIIAlpha : "ASCII alphabetical";
ASCIIAlphaNum : "ASCII alphanumeric";
Alpha : "Unicode alphabetical";
AlphaNum : "Unicode alphanumeric";
Digit : "Unicode decimal digit";
HexDigit : "Unicode hex digit";
Whitespace : "Whitespace content";
EndEnum;This enumerated type defines the character types that are supported by the IsOfType() method. IsOfType() supports character type testing, and this enumerated type indicates what type you want to test the character against.
Constructors:
Constructor();
Constructor([In] MEng.Char InitVal);
There is one default constructor, which will set the initial value to the space character (code point 32), and a constructor that takes an initial value.
Final, Const Methods:
Equal([In] MEng.Card4 ToComp) Returns MEng.Boolean;
operator=([In] MEng.Card4 Src1, [In] MEng.Card4 Src2) Returns MEng.Boolean;
Compares the two objects and returns True if they are equal and False if they are unequal. Neither object is affected. They do the same thing, are only only syntactically different.
GetOrdinal() Returns MEng.Card4;
Returns the ordinal value of the character. The ordinal value is the numerical Unicode code point for the character. This is a means to convert a character to a numeric value.
GtThan([In] MEng.Char ToComp) Returns MEng.Boolean;
operator>([In] MEng.Char Src1, [In] MEng.Char Src2) Returns MEng.Boolean;
GtThanEq([In] MEng.Char ToComp) Returns MEng.Boolean;
operator>=([In] MEng.Char Src1, [In] MEng.Char Src2) Returns MEng.Boolean;
Compares the two objects and returns True if the left hand object is greater (or greater than or equal), else it returns False. Neither object is affected. The two sets do the same thing, and are just syntactically different.
IsOfType([In] CharTypes ToTest) Returns MEng.Boolean;
Compares this character to see if it is a member of the indicated character type set. If so, the return is True, else False.
LsThan([In] MEng.Char ToComp) Returns MEng.Boolean;
operator<([In] MEng.Char Src1, [In] MEng.Char Src2) Returns MEng.Boolean;
LsThanEq([In] MEng.Char ToComp) Returns MEng.Boolean;
operator<=([In] MEng.Char Src1, [In] MEng.Char Src2) Returns MEng.Boolean;
Compares the two objects and returns True if the left hand object is less than (or less than or equal) the right hand object, else it returns False. Neither object is affected. The two sets do the same thing, and are just syntactically different.
Final, Non-Const Methods:
OfsOrdinal([In] MEng.Int4 OfsBy) Returns MEng.Int4;
Offsets the ordinal value of the character, which is a means of playing tricks and adjusting the character by some numeric value. This will offset the Unicode code point of the character by the passed value. If this creates an invalid character, it will not be caught until you try to use it.
SetOrdinal([In] MEng.Card4 ToSet);
Sets this character's ordinal value, which is a means to get a numeric value converted to a character. The passed in value must be the Unicode code point for the desired character.