VSS.Strings.Converters.Encoders

Entities

Tagged Types

Subprograms

Description

This package provides string data encoder from Virtual_String to external encoding.

Encode

function Encode
  (Self : in out Virtual_String_Encoder'Class;
   Item : VSS.Characters.Virtual_Character)
   return VSS.Stream_Element_Vectors.Stream_Element_Vector

Encode Item and return result. When Stateless flag was set to False, it returns only fully decoded portion of the data, and save incomplete data to be encoded with next call of Encode. When Stateless flag was set to True, incomplete data is not allowed, it will be returned as encoding error.

Parameters
Self
Item
Return Value

Encode

function Encode
  (Self : in out Virtual_String_Encoder'Class;
   Item : VSS.Strings.Virtual_String'Class)
   return VSS.Stream_Element_Vectors.Stream_Element_Vector

Encode Item and return result. When Stateless flag was set to False, it returns only fully decoded portion of the data, and save incomplete data to be encoded with next call of Encode. When Stateless flag was set to True, incomplete data is not allowed, it will be returned as encoding error.

Parameters
Self
Item
Return Value

Encode

procedure Encode
  (Self   : in out Virtual_String_Encoder'Class;
   Item   : VSS.Characters.Virtual_Character;
   Buffer : in out VSS.Stream_Element_Vectors.Stream_Element_Vector)

Encode Item and append result to given Buffer. When Stateless flag was set to False, it returns only fully decoded portion of the data, and save incomplete data to be encoded with next call of Encode. When Stateless flag was set to True, incomplete data is not allowed, it will be returned as encoding error.

Parameters
Self
Item
Buffer

Encode

procedure Encode
  (Self   : in out Virtual_String_Encoder'Class;
   Item   : VSS.Strings.Virtual_String'Class;
   Buffer : in out VSS.Stream_Element_Vectors.Stream_Element_Vector)

Encode Item and append result to given Buffer. When Stateless flag was set to False, it returns only fully decoded portion of the data, and save incomplete data to be encoded with next call of Encode. When Stateless flag was set to True, incomplete data is not allowed, it will be returned as encoding error.

Parameters
Self
Item
Buffer

Error_Message

function Error_Message
  (Self : Virtual_String_Encoder'Class) return VSS.Strings.Virtual_String

Return error message for latest detected error.

Parameters
Self
Return Value

Has_Error

function Has_Error (Self : Virtual_String_Encoder'Class) return Boolean

Return True when some error has been found during encoding.

Parameters
Self
Return Value

Initialize

procedure Initialize
  (Self     : in out Virtual_String_Encoder'Class;
   Encoding : VSS.Strings.Virtual_String;
   Flags    : Converter_Flags := Default_Converter_Flags)

Initialize text encoder to encode text data in given encoding. Is_Valid return True when encoder has been initialized successfully.

Parameters
Self
Encoding
Flags

Is_Valid

function Is_Valid (Self : Virtual_String_Encoder'Class) return Boolean

Return True when encoder is initialized successfully.

Parameters
Self
Return Value

Reset_State

procedure Reset_State (Self : in out Virtual_String_Encoder'Class)

Reset state of the encoder to initial (after call of Initialize). All accumulated incomplete data will be lost.

Parameters
Self

Virtual_String_Encoder

type Virtual_String_Encoder is tagged limited private;