class ConvertUtf8

namespace sys.core
class ConvertUtf8

A class implementing conversions to and from binary data and Utf8 buffers.

Methods

IntAsText

static func IntAsText(ref buffer: Slice, data: Int);
static func IntAsText(ref buffer: Slice, data: Int, base: DWord);

Brief

Writes a Int to a buffer as an Utf8 text.

The buffer `Length` is updated to the number of code units written.

Parameters

buffer the output buffer
data the value to write
base the base to use

LongAsText

static func LongAsText(ref buffer: Slice, data: Long);
static func LongAsText(ref buffer: Slice, data: Long, base: DWord);

Brief

Writes a Long to a buffer as an Utf8 text.

The buffer `Length` is updated to the number of code units written.

Parameters

buffer the output buffer
data the value to write
base the base to use

DWordAsText

static func DWordAsText(ref buffer: Slice, val value: DWord);
static func DWordAsText(ref buffer: Slice, val value: DWord, base: DWord);

Brief

Writes a DWord to a buffer as an Utf8 text.

The buffer `Length` is updated to the number of code units written.

Parameters

buffer the output buffer
value the value to write
base the base to use

QWordAsText

static func QWordAsText(ref buffer: Slice, val value: QWord);
static func QWordAsText(ref buffer: Slice, val value: QWord, base: DWord);

Brief

Writes a QWord to a buffer as an Utf8 text.

The buffer `Length` is updated to the number of code units written.

Parameters

buffer the output buffer
value the value to write
base the base to use

FloatAsText

static func FloatAsText(ref buffer: Slice, data: Float);

Brief

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.

Parameters

buffer the output buffer
data the value to write

DoubleAsText

static func DoubleAsText(ref buffer: Slice, data: Double);

Brief

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.

Parameters

buffer the output buffer
data the value to write

CharAsText

static func CharAsText(ref buffer: Slice, data: Char);

Brief

Writes a Char to a buffer as an Utf8 text.

The buffer `Length` is updated to the number of code units written.

Parameters

buffer the output buffer
data the value to write

FromUtf16

static func FromUtf16(ref dest: Slice, ref src: ReadSlice);

Brief

Converts a source Utf16 buffer to a destination Utf8 buffer.

Parameters

dest the destination buffer
src the source buffer

FromUtf32

static func FromUtf32(ref dest: Slice, ref src: ReadSlice);

Brief

Converts a source Utf32 buffer to a destination Utf8 buffer.

Parameters

dest the destination buffer
src the source buffer

ParseSig

ParseSig(ref buffer: ReadSlice): T;

Brief

Parses a singed integer.


ParseSigSaturated

ParseSigSaturated(ref buffer: ReadSlice): T;

Brief

Parses and saturates a singed integer.


ParseUns

ParseUns(ref buffer: ReadSlice): T;

Brief

Parses an unsigned integer.


ParseUnsSaturated

ParseUnsSaturated(ref buffer: ReadSlice): T;

Brief

Parses and saturates an unsigned integer.

Constants

MaxSmallBuffer

const MaxSmallBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Small value.


MaxShortBuffer

const MaxShortBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Short value.


MaxIntBuffer

const MaxIntBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Int value.


MaxLongBuffer

const MaxLongBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Long value.


MaxByteBuffer

const MaxByteBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Byte value.


MaxWordBuffer

const MaxWordBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a Word value.


MaxDWordBuffer

const MaxDWordBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a DWord value.


MaxQWordBuffer

const MaxQWordBuffer;

Brief

The maximum required Utf8 buffer size to store the textual form of a QWord value.


MaxBinSmallBuffer

const MaxBinSmallBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Small value.


MaxBinShortBuffer

const MaxBinShortBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Short value.


MaxBinIntBuffer

const MaxBinIntBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Int value.


MaxBinLongBuffer

const MaxBinLongBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Long value.


MaxBinByteBuffer

const MaxBinByteBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Byte value.


MaxBinWordBuffer

const MaxBinWordBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Word value.


MaxBinDWordBuffer

const MaxBinDWordBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a DWord value.


MaxBinQWordBuffer

const MaxBinQWordBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a QWord value.


MaxCharBuffer

const MaxCharBuffer;

Brief

The maximum required Utf8 buffer size to store the base 2 textual form of a Char value.