TBLString
Byte string.
Blend2D always uses UTF-8 encoding in public APIs so all strings are assumed UTF-8 by default. However, TBLString
doesn't guarantee any assumptions about the encoding of the data it holds. It can hold arbitrary byte sequence and act as a raw byte-string when this functionality is desired.
Definition
Unit: Blend2D
Remarks
Most Blend2D API's use TBLString
instead of Delphi's built-in String (UnicodeString) type since TBLString
can be more efficient for short strings. If you use the same string multiple times, it's more efficient to keep a TBLString
value around instead recreating them or using regular strings, to avoid Unicode-to-UTF8 conversions.
Properties
Name | Description |
---|---|
Capacity | The capacity of the string [in bytes or number of UTF8 characters]. |
Chars | The characters at the given AIndex (0-based). |
Data | Pointer to the data of the string. |
IsEmpty | Whether the string is empty. |
Size | The size of the string [in bytes or number of UTF8 characters]. |
Constructors
Name | Description |
---|---|
Assign | Copy constructor. |
Create(UTF8String) | Constructor that creates a string from a Delphi UTF8String. |
Create(String) | Constructor that creates a string from a Delphi (Unicode) String. |
Create(PUTF8Char, NativeInt) | Constructor that creates a string from the given UTF8 data specified by AStr and ASize . If ASize is -1 the string is assumed to be null terminated. |
Create(TBLStringView) | Constructor that creates a string from the given string AView . |
Finalize | Destroys the string. |
Initialize | Creates an empty string. |
Operators
Methods
Name | Description |
---|---|
Append(String) | |
Append(UTF8String) | |
Append(PUTF8Char, NativeInt) | |
Append(TBLStringView) | |
Append(TBLString) | |
Append(UTF8Char, NativeInt) | |
AppendFormat | |
Assign(PUTF8Char, NativeInt) | Replaces the string by AStr data of the given length ASize . |
Assign(TBLStringView) | Replaces the string by the content described by the given string AView . |
Assign(UTF8Char, NativeInt) | Replaces the content of the string by AChar character or multiple characters if ACount is greater than one. |
AssignDeep | Copy assignment, but creates a deep copy of the AOther string instead of weak copy. |
AssignFormat | Replaces the content of the string by a result of calling Format(AFmt, AArgs) . |
At | Returns a character at the given AIndex . |
Clear | Clears the content of the string without releasing its dynamically allocated data, if possible. |
Compare(String) | Compares this string with other string data and returns either -1 , 0 , or 1 . |
Compare(UTF8String) | Compares this string with other string data and returns either -1 , 0 , or 1 . |
Compare(PUTF8Char, NativeInt) | Compares this string with other string data and returns either -1 , 0 , or 1 . |
Compare(TBLStringView) | Compares this string with other string AView and returns either -1 , 0 , or 1 . |
Compare(TBLString) | Compares this string with AOther and returns either -1 , 0 , or 1 . |
Equals(String) | Returns whether this string and the given Unicode string data AStr are equal. |
Equals(UTF8String) | Returns whether this string and the given UTF8 string data AStr are equal. |
Equals(PUTF8Char, NativeInt) | Returns whether this string and the given string data AStr of length ASize are equal. |
Equals(TBLStringView) | Returns whether this string and other string AView are equal. |
Equals(TBLString) | Returns whether this string and AOther are equal (i.e. their contents match). |
IndexOf(UTF8Char, NativeInt) | Returns the index at which a given character AChar can be found in the string starting from AFromIndex , or -1 if not present. |
IndexOf(UTF8Char) | Returns the first index at which a given character AChar can be found in the string, or -1 if not present. |
Insert(NativeInt, String) | |
Insert(NativeInt, UTF8String) | |
Insert(NativeInt, PUTF8Char, NativeInt) | |
Insert(NativeInt, TBLStringView) | |
Insert(NativeInt, TBLString) | |
Insert(NativeInt, UTF8Char, NativeInt) | |
InsertOp | |
LastIndexOf(UTF8Char, NativeInt) | Returns the index at which a given character AChar can be found in the string starting from AFromIndex and ending at 0 , or -1 if not present. |
LastIndexOf(UTF8Char) | Returns the last index at which a given character AChar can be found in the string, or -1 if not present. |
MakeMutable | Makes the string mutable. |
ModifyOp | |
Prepend(String) | |
Prepend(UTF8String) | |
Prepend(PUTF8Char, NativeInt) | |
Prepend(TBLStringView) | |
Prepend(TBLString) | |
Prepend(UTF8Char, NativeInt) | |
Remove(TBLRange) | |
Remove(NativeInt) | |
Reserve | Reserves at least AMinSize bytes (UTF8 characters) in the string for further manipulation (most probably appending). |
Reset | Clears the content of the string and releases its data. |
Resize | Resizes the string to ASize and fills the additional data by AFill pattern. |
Shrink | Shrinks the capacity of the string to match the actual content. |
Swap | Swaps the content of this string with the AOther string. |
ToString | Converts to a Delphi string |
Truncate | Truncates the string length to ASize . |
View | Returns the content of the string as TBLStringView . |
Property Descriptions
Capacity
The capacity of the string [in bytes or number of UTF8 characters].
property Capacity: NativeInt read GetCapacity
Type: NativeInt
Chars
The characters at the given AIndex
(0-based).
property Chars[const AIndex: NativeInt]: UTF8Char read GetChar; default
Type: UTF8Char
Remarks
This is the same as calling At(AIndex)
. Index must be valid and cannot be out of bounds - there is an assertion.
Data
Pointer to the data of the string.
property Data: PUTF8Char read GetData
Type: PUTF8Char
IsEmpty
Whether the string is empty.
property IsEmpty: Boolean read GetIsEmpty
Type: Boolean
Size
The size of the string [in bytes or number of UTF8 characters].
property Size: NativeInt read GetSize
Type: NativeInt
Constructor Descriptions
Assign
Copy constructor.
Performs weak copy of the data held by the ASrc
string.
constructor Assign(var ADest: TBLString; const ASrc: TBLString); inline
Parameters
ADest
: TBLString
ASrc
: TBLString
Exceptions
EBlend2DError
: Raised on failure.
Create
Constructor that creates a string from a Delphi UTF8String.
constructor Create(const AStr: UTF8String); overload
Parameters
AStr
: UTF8String
Exceptions
EBlend2DError
: Raised on failure.
Create
Constructor that creates a string from a Delphi (Unicode) String.
constructor Create(const AStr: String); overload
Parameters
AStr
: String
Exceptions
EBlend2DError
: Raised on failure.
Remarks
This involves a Unicode-to-UTF8 conversion.
Create
Constructor that creates a string from the given UTF8 data specified by AStr
and ASize
. If ASize
is -1 the string is assumed to be null terminated.
This is a convenience function that doesn't provide error handling. If size exceeds small string capacity and dynamic allocation failed then a default empty string would be constructed.
constructor Create(const AStr: PUTF8Char; const ASize: NativeInt = -1); overload
Parameters
AStr
: PUTF8Char
ASize
: NativeInt = -1
Exceptions
EBlend2DError
: Raised on failure.
Create
Constructor that creates a string from the given string AView
.
constructor Create(const AView: TBLStringView); overload
Parameters
AView
: TBLStringView
Exceptions
EBlend2DError
: Raised on failure.
Finalize
Destroys the string.
destructor Finalize(var ADest: TBLString)
Parameters
ADest
: TBLString
Exceptions
EBlend2DError
: Raised on failure.
Initialize
Creates an empty string.
constructor Initialize(out ADest: TBLString)
Parameters
ADest
: TBLString
Exceptions
EBlend2DError
: Raised on failure.
Operator Descriptions
Equal(TBLString, String)
class operator Equal(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
Equal(TBLString, UTF8String)
class operator Equal(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
Equal(TBLString, PUTF8Char)
class operator Equal(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
Equal(TBLString, TBLStringView)
class operator Equal(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
Equal(TBLString, TBLString)
Returns True if two strings are equal (have the same contents).
class operator Equal(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
Equal(TBLString, Pointer)
Used to compare against nil
(empty string).
class operator Equal(const ALeft: TBLString; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: Pointer
Returns
Boolean
GreaterThan(TBLString, String)
class operator GreaterThan(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
GreaterThan(TBLString, UTF8String)
class operator GreaterThan(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
GreaterThan(TBLString, PUTF8Char)
class operator GreaterThan(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
GreaterThan(TBLString, TBLStringView)
class operator GreaterThan(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
GreaterThan(TBLString, TBLString)
class operator GreaterThan(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
GreaterThanOrEqual(TBLString, String)
class operator GreaterThanOrEqual(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
GreaterThanOrEqual(TBLString, UTF8String)
class operator GreaterThanOrEqual(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
GreaterThanOrEqual(TBLString, PUTF8Char)
class operator GreaterThanOrEqual(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
GreaterThanOrEqual(TBLString, TBLStringView)
class operator GreaterThanOrEqual(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
GreaterThanOrEqual(TBLString, TBLString)
class operator GreaterThanOrEqual(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
Implicit(UTF8String)
Implicitly convers a Delphi UTF8String to a TBLString.
class operator Implicit(const AStr: UTF8String): TBLString; inline; static
Parameters
AStr
: UTF8String
Returns
Exceptions
EBlend2DError
: Raised on failure.
Implicit(String)
Implicitly convers a Delphi (Unicode) String to a TBLString.
class operator Implicit(const AStr: String): TBLString; inline; static
Parameters
AStr
: String
Returns
Exceptions
EBlend2DError
: Raised on failure.
Remarks
This involves a Unicode-to-UTF8 conversion.
LessThan(TBLString, String)
class operator LessThan(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
LessThan(TBLString, UTF8String)
class operator LessThan(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
LessThan(TBLString, PUTF8Char)
class operator LessThan(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
LessThan(TBLString, TBLStringView)
class operator LessThan(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
LessThan(TBLString, TBLString)
class operator LessThan(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
LessThanOrEqual(TBLString, String)
class operator LessThanOrEqual(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
LessThanOrEqual(TBLString, UTF8String)
class operator LessThanOrEqual(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
LessThanOrEqual(TBLString, PUTF8Char)
class operator LessThanOrEqual(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
LessThanOrEqual(TBLString, TBLStringView)
class operator LessThanOrEqual(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
LessThanOrEqual(TBLString, TBLString)
class operator LessThanOrEqual(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
NotEqual(TBLString, String)
class operator NotEqual(const ALeft: TBLString; const ARight: String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: String
Returns
Boolean
NotEqual(TBLString, UTF8String)
class operator NotEqual(const ALeft: TBLString; const ARight: UTF8String): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: UTF8String
Returns
Boolean
NotEqual(TBLString, PUTF8Char)
class operator NotEqual(const ALeft: TBLString; const ARight: PUTF8Char): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: PUTF8Char
Returns
Boolean
NotEqual(TBLString, TBLStringView)
class operator NotEqual(const ALeft: TBLString; const ARight: TBLStringView): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLStringView
Returns
Boolean
NotEqual(TBLString, TBLString)
Returns True if two strings are not equal (do not have the same contents).
class operator NotEqual(const ALeft, ARight: TBLString): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: TBLString
Returns
Boolean
NotEqual(TBLString, Pointer)
Used to compare against nil
(empty string).
class operator NotEqual(const ALeft: TBLString; const ARight: Pointer): Boolean; inline; static
Parameters
ALeft
: TBLString
ARight
: Pointer
Returns
Boolean
Method Descriptions
Append(String)
procedure Append(const AStr: String); overload; inline
Parameters
AStr
: String
Append(UTF8String)
procedure Append(const AStr: UTF8String); overload; inline
Parameters
AStr
: UTF8String
Append(PUTF8Char, NativeInt)
procedure Append(const AStr: PUTF8Char; const ASize: NativeInt = -1); overload; inline
Parameters
AStr
: PUTF8Char
ASize
: NativeInt = -1
Append(TBLStringView)
procedure Append(const AView: TBLStringView); overload; inline
Parameters
AView
: TBLStringView
Append(TBLString)
procedure Append(const AOther: TBLString); overload; inline
Parameters
AOther
: TBLString
Append(UTF8Char, NativeInt)
procedure Append(const AChar: UTF8Char; const ACount: NativeInt = 1); overload; inline
Parameters
AChar
: UTF8Char
ACount
: NativeInt = 1
AppendFormat(String, const[])
procedure AppendFormat(const AFmt: String; const AArgs: array of const)
Parameters
AFmt
: String
AArgs
: array of const
Assign(PUTF8Char, NativeInt)
Replaces the string by AStr
data of the given length ASize
.
procedure Assign(const AStr: PUTF8Char; const ASize: NativeInt = -1); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AStr
: PUTF8Char
ASize
: NativeInt = -1
Remarks
The implementation assumes null terminated string if ASize
equals to -1
.
Assign(TBLStringView)
Replaces the string by the content described by the given string AView
.
procedure Assign(const AView: TBLStringView); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AView
: TBLStringView
Assign(UTF8Char, NativeInt)
Replaces the content of the string by AChar
character or multiple characters if ACount
is greater than one.
procedure Assign(const AChar: UTF8Char; const ACount: NativeInt = 1); overload; inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AChar
: UTF8Char
ACount
: NativeInt = 1
AssignDeep(TBLString)
Copy assignment, but creates a deep copy of the AOther
string instead of weak copy.
procedure AssignDeep(const AOther: TBLString); inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AOther
: TBLString
AssignFormat(String, const[])
Replaces the content of the string by a result of calling Format(AFmt, AArgs)
.
procedure AssignFormat(const AFmt: String; const AArgs: array of const)
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AFmt
: String
AArgs
: array of const
Remarks
This involves a Unicode-to-UTF8 conversion.
At(NativeInt)
Returns a character at the given AIndex
.
function At(const AIndex: NativeInt): UTF8Char; inline
Parameters
AIndex
: NativeInt
Returns
UTF8Char
Remarks
Index must be valid and cannot be out of bounds - there is an assertion.
Clear
Clears the content of the string without releasing its dynamically allocated data, if possible.
procedure Clear; inline
Exceptions
EBlend2DError
: Raised on failure.
Compare(String)
Compares this string with other string data and returns either -1
, 0
, or 1
.
function Compare(const AOther: String): Integer; overload; inline
Parameters
AOther
: String
Returns
Integer
Remarks
This involves a Unicode-to-UTF8 conversion of AOther.
Compare(UTF8String)
Compares this string with other string data and returns either -1
, 0
, or 1
.
function Compare(const AOther: UTF8String): Integer; overload; inline
Parameters
AOther
: UTF8String
Returns
Integer
Compare(PUTF8Char, NativeInt)
Compares this string with other string data and returns either -1
, 0
, or 1
.
function Compare(const AOther: PUTF8Char; const ASize: NativeInt = -1): Integer; overload; inline
Parameters
AOther
: PUTF8Char
ASize
: NativeInt = -1
Returns
Integer
Compare(TBLStringView)
Compares this string with other string AView
and returns either -1
, 0
, or 1
.
function Compare(const AOther: TBLStringView): Integer; overload; inline
Parameters
AOther
: TBLStringView
Returns
Integer
Compare(TBLString)
Compares this string with AOther
and returns either -1
, 0
, or 1
.
function Compare(const AOther: TBLString): Integer; overload; inline
Parameters
AOther
: TBLString
Returns
Integer
Equals(String)
Returns whether this string and the given Unicode string data AStr
are equal.
function Equals(const AOther: String): Boolean; overload; inline
Parameters
AOther
: String
Returns
Boolean
Remarks
This involves a Unicode-to-UTF8 conversion of AOther.
Equals(UTF8String)
Returns whether this string and the given UTF8 string data AStr
are equal.
function Equals(const AOther: UTF8String): Boolean; overload; inline
Parameters
AOther
: UTF8String
Returns
Boolean
Equals(PUTF8Char, NativeInt)
Returns whether this string and the given string data AStr
of length ASize
are equal.
function Equals(const AOther: PUTF8Char; const ASize: NativeInt = -1): Boolean; overload; inline
Parameters
AOther
: PUTF8Char
ASize
: NativeInt = -1
Returns
Boolean
Equals(TBLStringView)
Returns whether this string and other string AView
are equal.
function Equals(const AOther: TBLStringView): Boolean; overload; inline
Parameters
AOther
: TBLStringView
Returns
Boolean
Equals(TBLString)
Returns whether this string and AOther
are equal (i.e. their contents match).
function Equals(const AOther: TBLString): Boolean; overload; inline
Parameters
AOther
: TBLString
Returns
Boolean
IndexOf(UTF8Char, NativeInt)
Returns the index at which a given character AChar
can be found in the string starting from AFromIndex
, or -1 if not present.
function IndexOf(const AChar: UTF8Char; const AFromIndex: NativeInt): NativeInt; overload; inline
Parameters
AChar
: UTF8Char
AFromIndex
: NativeInt
Returns
NativeInt
IndexOf(UTF8Char)
Returns the first index at which a given character AChar
can be found in the string, or -1 if not present.
function IndexOf(const AChar: UTF8Char): NativeInt; overload; inline
Parameters
AChar
: UTF8Char
Returns
NativeInt
Insert(NativeInt, String)
procedure Insert(const AIndex: NativeInt; const AStr: String); overload; inline
Parameters
AIndex
: NativeInt
AStr
: String
Insert(NativeInt, UTF8String)
procedure Insert(const AIndex: NativeInt; const AStr: UTF8String); overload; inline
Parameters
AIndex
: NativeInt
AStr
: UTF8String
Insert(NativeInt, PUTF8Char, NativeInt)
procedure Insert(const AIndex: NativeInt; const AStr: PUTF8Char; const ASize: NativeInt = -1); overload; inline
Parameters
AIndex
: NativeInt
AStr
: PUTF8Char
ASize
: NativeInt = -1
Insert(NativeInt, TBLStringView)
procedure Insert(const AIndex: NativeInt; const AView: TBLStringView); overload; inline
Parameters
AIndex
: NativeInt
AView
: TBLStringView
Insert(NativeInt, TBLString)
procedure Insert(const AIndex: NativeInt; const AOther: TBLString); overload; inline
Parameters
AIndex
: NativeInt
AOther
: TBLString
Insert(NativeInt, UTF8Char, NativeInt)
procedure Insert(const AIndex: NativeInt; const AChar: UTF8Char; const ACount: NativeInt = 1); overload; inline
Parameters
AIndex
: NativeInt
AChar
: UTF8Char
ACount
: NativeInt = 1
InsertOp(NativeInt, NativeInt)
function InsertOp(const AIndex, ASize: NativeInt): PUTF8Char; inline
Parameters
AIndex
: NativeInt
ASize
: NativeInt
Returns
PUTF8Char
LastIndexOf(UTF8Char, NativeInt)
Returns the index at which a given character AChar
can be found in the string starting from AFromIndex
and ending at 0
, or -1 if not present.
function LastIndexOf(const AChar: UTF8Char; const AFromIndex: NativeInt): NativeInt; overload; inline
Parameters
AChar
: UTF8Char
AFromIndex
: NativeInt
Returns
NativeInt
LastIndexOf(UTF8Char)
Returns the last index at which a given character AChar
can be found in the string, or -1 if not present.
function LastIndexOf(const AChar: UTF8Char): NativeInt; overload; inline
Parameters
AChar
: UTF8Char
Returns
NativeInt
MakeMutable
Makes the string mutable.
This operation checks whether the string is mutable and if not it makes a deep copy of its content so it can be modified. Please note that you can only modify the content that is defined by its length property. Even if the string had higher capacity before MakeMutable
it's not guaranteed that the possible new data would match that capacity.
If you want to make the string mutable for the purpose of appending or making other modifications please consider using ModifyOp
and InsertOp
instead.
function MakeMutable: PUTF8Char; inline
Exceptions
EBlend2DError
: Raised on failure.
Returns
PUTF8Char
See Also
ModifyOp(TBLModifyOp, NativeInt)
function ModifyOp(const AOp: TBLModifyOp; const ASize: NativeInt): PUTF8Char; inline
Parameters
AOp
: TBLModifyOp
ASize
: NativeInt
Returns
PUTF8Char
Prepend(String)
procedure Prepend(const AStr: String); overload; inline
Parameters
AStr
: String
Prepend(UTF8String)
procedure Prepend(const AStr: UTF8String); overload; inline
Parameters
AStr
: UTF8String
Prepend(PUTF8Char, NativeInt)
procedure Prepend(const AStr: PUTF8Char; const ASize: NativeInt = -1); overload; inline
Parameters
AStr
: PUTF8Char
ASize
: NativeInt = -1
Prepend(TBLStringView)
procedure Prepend(const AView: TBLStringView); overload; inline
Parameters
AView
: TBLStringView
Prepend(TBLString)
procedure Prepend(const AOther: TBLString); overload; inline
Parameters
AOther
: TBLString
Prepend(UTF8Char, NativeInt)
procedure Prepend(const AChar: UTF8Char; const ACount: NativeInt = 1); overload; inline
Parameters
AChar
: UTF8Char
ACount
: NativeInt = 1
Remove(TBLRange)
procedure Remove(const ARange: TBLRange); overload; inline
Parameters
ARange
: TBLRange
Remove(NativeInt)
procedure Remove(const AIndex: NativeInt); overload; inline
Parameters
AIndex
: NativeInt
Reserve(NativeInt)
Reserves at least AMinSize
bytes (UTF8 characters) in the string for further manipulation (most probably appending).
procedure Reserve(const AMinSize: NativeInt); inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
AMinSize
: NativeInt
Reset
Clears the content of the string and releases its data.
After reset the string content matches a default constructed string.
procedure Reset; inline
Exceptions
EBlend2DError
: Raised on failure.
Resize(NativeInt, UTF8Char)
Resizes the string to ASize
and fills the additional data by AFill
pattern.
procedure Resize(const ASize: NativeInt; const AFill: UTF8Char = #0); inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
ASize
: NativeInt
AFill
: UTF8Char = #0
Shrink
Shrinks the capacity of the string to match the actual content.
procedure Shrink; inline
Exceptions
EBlend2DError
: Raised on failure.
Swap(TBLString)
Swaps the content of this string with the AOther
string.
procedure Swap(var AOther: TBLString); inline
Parameters
AOther
: TBLString
ToString
Converts to a Delphi string
function ToString: String; inline
Returns
String
Truncate(NativeInt)
Truncates the string length to ASize
.
It does nothing if the the string length is less than ASize
.
procedure Truncate(const ASize: NativeInt); inline
Exceptions
EBlend2DError
: Raised on failure.
Parameters
ASize
: NativeInt
View
Returns the content of the string as TBLStringView
.
function View: TBLStringView; inline