This package provides string data encoder from Virtual_String to external encoding.
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.
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.
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.
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.
function Error_Message
(Self : Virtual_String_Encoder'Class) return VSS.Strings.Virtual_String
Return error message for latest detected error.
function Has_Error (Self : Virtual_String_Encoder'Class) return Boolean
Return True when some error has been found during encoding.
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.
function Is_Valid (Self : Virtual_String_Encoder'Class) return Boolean
Return True when encoder is initialized successfully.
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.
type Virtual_String_Encoder is tagged limited private;