namespace sys.core
class ConvertUtf8
A class implementing conversions to and from binary data and Utf8 buffers.
static func IntAsText(ref buffer: Slice, data: Int);
static func IntAsText(ref buffer: Slice, data: Int, base: DWord);
Writes a Int to a buffer as an Utf8 text.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
data | the value to write |
base | the base to use |
static func LongAsText(ref buffer: Slice, data: Long);
static func LongAsText(ref buffer: Slice, data: Long, base: DWord);
Writes a Long to a buffer as an Utf8 text.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
data | the value to write |
base | the base to use |
static func DWordAsText(ref buffer: Slice, val value: DWord);
static func DWordAsText(ref buffer: Slice, val value: DWord, base: DWord);
Writes a DWord to a buffer as an Utf8 text.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
value | the value to write |
base | the base to use |
static func QWordAsText(ref buffer: Slice, val value: QWord);
static func QWordAsText(ref buffer: Slice, val value: QWord, base: DWord);
Writes a QWord to a buffer as an Utf8 text.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
value | the value to write |
base | the base to use |
static func FloatAsText(ref buffer: Slice, data: Float);
Writes a Float to a buffer as an Utf8 text.
Will use exponenet notation for large values.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
data | the value to write |
static func DoubleAsText(ref buffer: Slice, data: Double);
Writes a Double to a buffer as an Utf8 text.
Will use exponenet notation for large values.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
data | the value to write |
static func CharAsText(ref buffer: Slice, data: Char);
Writes a Char to a buffer as an Utf8 text.
The buffer `Length` is updated to the number of code units written.
buffer | the output buffer |
---|---|
data | the value to write |
static func FromUtf16(ref dest: Slice, ref src: ReadSlice);
Converts a source Utf16 buffer to a destination Utf8 buffer.
dest | the destination buffer |
---|---|
src | the source buffer |
static func FromUtf32(ref dest: Slice, ref src: ReadSlice);
Converts a source Utf32 buffer to a destination Utf8 buffer.
dest | the destination buffer |
---|---|
src | the source buffer |
ParseSig(ref buffer: ReadSlice): T;
Parses a singed integer.
ParseSigSaturated(ref buffer: ReadSlice): T;
Parses and saturates a singed integer.
ParseUns(ref buffer: ReadSlice): T;
Parses an unsigned integer.
ParseUnsSaturated(ref buffer: ReadSlice): T;
Parses and saturates an unsigned integer.
const MaxSmallBuffer;
The maximum required Utf8 buffer size to store the textual form of a Small value.
const MaxShortBuffer;
The maximum required Utf8 buffer size to store the textual form of a Short value.
const MaxIntBuffer;
The maximum required Utf8 buffer size to store the textual form of a Int value.
const MaxLongBuffer;
The maximum required Utf8 buffer size to store the textual form of a Long value.
const MaxByteBuffer;
The maximum required Utf8 buffer size to store the textual form of a Byte value.
const MaxWordBuffer;
The maximum required Utf8 buffer size to store the textual form of a Word value.
const MaxDWordBuffer;
The maximum required Utf8 buffer size to store the textual form of a DWord value.
const MaxQWordBuffer;
The maximum required Utf8 buffer size to store the textual form of a QWord value.
const MaxBinSmallBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Small value.
const MaxBinShortBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Short value.
const MaxBinIntBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Int value.
const MaxBinLongBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Long value.
const MaxBinByteBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Byte value.
const MaxBinWordBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Word value.
const MaxBinDWordBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a DWord value.
const MaxBinQWordBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a QWord value.
const MaxCharBuffer;
The maximum required Utf8 buffer size to store the base 2 textual form of a Char value.