Base class for DSL-generated variable QString(N) fields. QString supports UTF-16 (Unicode in .NET). N represents the total size of the string in bytes minus 2 bytes used for bookkeeping. In other words QString(64) will use 64 bytes for a string with a max byte length of 62 bytes, i.e. up to 31 UTF-16 characters.
More...
|
static unsafe bool | AreEqual< T > (ref T qstr, object other) |
| Check if two QStrings are equal. (CompareOrdinal) compares two strings by evaluating the numeric values of the corresponding characters in each string. More...
|
|
static bool | CanHold (string str, int maxByteCount) |
| Checks if the input string bytes are less than or equal to the given byte count. More...
|
|
static int | CompareOrdinal< T > (ref T qstr, byte *bytes, ushort byteCount) |
| Compares a string and a strings byte representation by evaluating the numeric values of the corresponding characters in each string. More...
|
|
static int | CompareOrdinal< T > (ref T qstr, string str) |
| Compares a QString and a string by evaluating the numeric values of the corresponding characters in each string. More...
|
|
static int | CompareOrdinal< T, U > (ref T qstr1, ref U qstr2) |
| Compares two different QStrings types by evaluating the numeric values of the corresponding characters in each string. More...
|
|
static void | ConstructFrom< T > (string str, int maxByteCount, out T qstr) |
| Creates a QString from a string. More...
|
|
static void | ConstructNoByteCountCheck< T > (string str, int characterCount, int maxByteCount, out T qstr) |
| Create a QString from a string without checking the byte count. More...
|
|
static int | GetFittingCharacterCount (string str, int maxByteCount) |
| Calculate the number of characters that fit into the given byte count. More...
|
|
static int | GetFittingCharacterCount (string str, int maxByteCount, out int actualByteCount) |
| Calculate the number of characters that fit into the given byte count. More...
|
|
static int | GetLength< T > (ref T qstr) |
| Get the length of a QString. More...
|
|
static string | GetString< T > (ref T qstr) |
| Convert the QString to a String. More...
|
|
static void | Print (void *ptr, FramePrinter printer) |
| Prints the QString using a FramePrinter. More...
|
|
Base class for DSL-generated variable QString(N) fields. QString supports UTF-16 (Unicode in .NET). N represents the total size of the string in bytes minus 2 bytes used for bookkeeping. In other words QString(64) will use 64 bytes for a string with a max byte length of 62 bytes, i.e. up to 31 UTF-16 characters.
◆ AreEqual< T >()
static unsafe bool Quantum.QString.AreEqual< T > |
( |
ref T |
qstr, |
|
|
object |
other |
|
) |
| |
|
inlinestatic |
Check if two QStrings are equal. (CompareOrdinal) compares two strings by evaluating the numeric values of the corresponding characters in each string.
- Template Parameters
-
- Parameters
-
qstr | String a |
other | Other string |
- Returns
true
if string are equal
◆ CanHold()
static bool Quantum.QString.CanHold |
( |
string |
str, |
|
|
int |
maxByteCount |
|
) |
| |
|
inlinestatic |
Checks if the input string bytes are less than or equal to the given byte count.
- Parameters
-
str | String to check |
maxByteCount | Max bytes |
- Returns
true
if required bytes for the string is below or equal to the given size
◆ CompareOrdinal< T >() [1/2]
static int Quantum.QString.CompareOrdinal< T > |
( |
ref T |
qstr, |
|
|
byte * |
bytes, |
|
|
ushort |
byteCount |
|
) |
| |
|
inlinestatic |
Compares a string and a strings byte representation by evaluating the numeric values of the corresponding characters in each string.
- Template Parameters
-
- Parameters
-
qstr | QString string 1 |
bytes | Other string 2 in bytes representation |
byteCount | Other string byte length |
- Returns
- An integer that indicates the lexical relationship between the two comparands.
◆ CompareOrdinal< T >() [2/2]
static int Quantum.QString.CompareOrdinal< T > |
( |
ref T |
qstr, |
|
|
string |
str |
|
) |
| |
|
inlinestatic |
Compares a QString and a string by evaluating the numeric values of the corresponding characters in each string.
- Template Parameters
-
- Parameters
-
qstr | QString 1 |
str | String 2 |
- Returns
- An integer that indicates the lexical relationship between the two comparands.
◆ CompareOrdinal< T, U >()
static int Quantum.QString.CompareOrdinal< T, U > |
( |
ref T |
qstr1, |
|
|
ref U |
qstr2 |
|
) |
| |
|
inlinestatic |
Compares two different QStrings types by evaluating the numeric values of the corresponding characters in each string.
- Template Parameters
-
T | QString type |
U | QString type |
- Parameters
-
qstr1 | String 1 |
qstr2 | String 2 |
- Returns
- An integer that indicates the lexical relationship between the two comparands.
- Type Constraints
-
T | : | unmanaged | |
T | : | IQString | |
U | : | unmanaged | |
U | : | IQString | |
◆ ConstructFrom< T >()
static void Quantum.QString.ConstructFrom< T > |
( |
string |
str, |
|
|
int |
maxByteCount, |
|
|
out T |
qstr |
|
) |
| |
|
inlinestatic |
Creates a QString from a string.
- Template Parameters
-
- Parameters
-
str | String |
maxByteCount | Max byte count defined by the QString type |
qstr | Resulting QString |
- Exceptions
-
ArgumentException | Is raised when the string is too long |
◆ GetFittingCharacterCount() [1/2]
static int Quantum.QString.GetFittingCharacterCount |
( |
string |
str, |
|
|
int |
maxByteCount |
|
) |
| |
|
inlinestatic |
Calculate the number of characters that fit into the given byte count.
- Parameters
-
str | String |
maxByteCount | Max byte count defined by the QString type |
- Returns
- The number of characters that fit into the given byte count.
◆ GetFittingCharacterCount() [2/2]
static int Quantum.QString.GetFittingCharacterCount |
( |
string |
str, |
|
|
int |
maxByteCount, |
|
|
out int |
actualByteCount |
|
) |
| |
|
inlinestatic |
Calculate the number of characters that fit into the given byte count.
- Parameters
-
str | String |
maxByteCount | Max byte count defined by the QString type |
actualByteCount | Is set to the number of required bytes |
- Returns
- The number of characters that fit into the given byte count.
◆ GetLength< T >()
static int Quantum.QString.GetLength< T > |
( |
ref T |
qstr | ) |
|
|
inlinestatic |
Get the length of a QString.
- Template Parameters
-
- Parameters
-
- Returns
- Returns the character count.
◆ GetString< T >()
static string Quantum.QString.GetString< T > |
( |
ref T |
qstr | ) |
|
|
inlinestatic |
Convert the QString to a String.
- Template Parameters
-
- Parameters
-
- Returns
- String.
◆ Print()
static void Quantum.QString.Print |
( |
void * |
ptr, |
|
|
FramePrinter |
printer |
|
) |
| |
|
inlinestatic |
Prints the QString using a FramePrinter.
- Parameters
-
ptr | Pointer to QString instance |
printer | Printer object |
◆ ConstructNoByteCountCheck< T >()
static void Quantum.QString.ConstructNoByteCountCheck< T > |
( |
string |
str, |
|
|
int |
characterCount, |
|
|
int |
maxByteCount, |
|
|
out T |
qstr |
|
) |
| |
|
inlinestatic |
Create a QString from a string without checking the byte count.
- Template Parameters
-
- Parameters
-
str | String to convert |
characterCount | Not used |
maxByteCount | Not used |
qstr | Resulting QString |
◆ ByteCountFieldName
const string Quantum.QString.ByteCountFieldName = nameof(QStringCommonLayout.byteCount) |
|
static |
◆ BytesFieldName
const string Quantum.QString.BytesFieldName = nameof(QStringCommonLayout.bytes) |
|
static |