HString class

A string data type commonly used by Windows Runtime.

This class wraps the Windows Runtime memory allocation functions, allowing the creation of HSTRING types with ease, as shown below:

final hString = HString.fromString('Hello world!');

In general, freeing the memory allocated for a HString when it is no longer used is not a concern, as the Finalizer automatically releases it for you when the object becomes inaccessible to the program. However, you also have the option to manually release its memory by calling the object's free method.

Constructors

HString.empty()
Create an empty HString.
const
HString.fromHandle(int handle)
Create a HString from a given HSTRING handle.
factory
HString.fromString(String string)
Create a HString from a given Dart string.
factory

Properties

handle int
The handle to a HSTRING.
final
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether the string is empty.
no setter
length int
The length of the string.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clone() HString
Creates a copy of the existing string.
detach() → void
Detaches the object from the Finalizer.
free() → void
Releases the native memory allocated to the HString.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Converts the HString into a regular Dart string.
override

Operators

operator +(HString other) HString
Concatenates two HStrings.
operator ==(Object other) bool
The equality operator.
inherited