VSS.String_Vectors

Entities

Simple Types

Tagged Types

Constants

Subprograms

Generic Instantiations

Description

Vector of strings and operations on it.

"="

function "="
  (Left  : Virtual_String_Vector;
   Right : Virtual_String_Vector) return Boolean

Compare two string vectors.

Parameters
Left
Right
Return Value

Append

procedure Append
  (Self : in out Virtual_String_Vector'Class;
   Item : Virtual_String_Vector'Class)

Append strings of Item to the end of the vector.

Parameters
Self
Item

Append

procedure Append
  (Self : in out Virtual_String_Vector'Class;
   Item : VSS.Strings.Virtual_String'Class)

Append string to the end of the vector.

Parameters
Self
Item

Append_Syntax_Sugar

procedure Append_Syntax_Sugar
  (Self : in out Virtual_String_Vector;
   Item : VSS.Strings.Virtual_String)

Append operation to match expected profile of Aggregate aspect.

Parameters
Self
Item

Clear

procedure Clear (Self : in out Virtual_String_Vector'Class)

Remove all strings from the vector

Parameters
Self

Contains

function Contains
  (Self             : Virtual_String_Vector'Class;
   Item             : VSS.Strings.Virtual_String;
   Case_Sensitivity : VSS.Strings.Case_Sensitivity :=
     VSS.Strings.Case_Sensitive)
   return Boolean

Return True when vector contains given string.

Parameters
Self
Item
Case_Sensitivity
Return Value

Cursor

type Cursor is private;

Delete

procedure Delete
  (Self  : in out Virtual_String_Vector'Class;
   Index : Positive)

Delete element at the given index.

Parameters
Self
Index

Delete_First

function Delete_First
  (Self : Virtual_String_Vector'Class) return Virtual_String_Vector

Delete first element and return result vector.

Parameters
Self
Return Value

Delete_First

procedure Delete_First (Self : in out Virtual_String_Vector'Class)

Delete first element from the vector.

Parameters
Self

Delete_Last

procedure Delete_Last (Self : in out Virtual_String_Vector'Class)

Delete the last element.

Parameters
Self

Element

function Element
  (Self  : Virtual_String_Vector'Class;
   Index : Positive) return VSS.Strings.Virtual_String

Return given element. Return "null" string when index is out of bound.

Parameters
Self
Index
Return Value

Element

function Element
  (Self     : Virtual_String_Vector'Class;
   Position : Cursor) return VSS.Strings.Virtual_String
Parameters
Self
Position
Return Value

Empty_Virtual_String_Vector

Empty_Virtual_String_Vector : constant Virtual_String_Vector;

First

function First (Self : Reversible_Iterator) return Cursor
Parameters
Self
Return Value

First_Element

function First_Element
  (Self : Virtual_String_Vector'Class) return VSS.Strings.Virtual_String

Return first element of the vector.

Parameters
Self
Return Value

Has_Element

function Has_Element (Self : Cursor) return Boolean
Parameters
Self
Return Value

Is_Empty

function Is_Empty (Self : Virtual_String_Vector'Class) return Boolean

Return True when string vector is empty.

Parameters
Self
Return Value

Iterate

function Iterate
  (Self : Virtual_String_Vector'Class) return Reversible_Iterator

Return an iterator over each element in the vector

Parameters
Self
Return Value

Iterator_Interfaces

package Iterator_Interfaces is new Ada.Iterator_Interfaces
  (Cursor, Has_Element);

Join

function Join
  (Self      : Virtual_String_Vector'Class;
   Separator : VSS.Characters.Virtual_Character)
   return VSS.Strings.Virtual_String

Join all strings in the string vector into single string with each element separated by the given separator.

Parameters
Self
Separator
Return Value

Join_Lines

function Join_Lines
  (Self           : Virtual_String_Vector'Class;
   Terminator     : VSS.Strings.Line_Terminator;
   Terminate_Last : Boolean := True)
   return VSS.Strings.Virtual_String

Join all string vector's strings with each element separated by given Terminator. When Terminate_Last is True line terminator is added after last line.

Parameters
Self
Terminator
Terminate_Last
Return Value

Last

function Last (Self : Reversible_Iterator) return Cursor
Parameters
Self
Return Value

Last_Element

function Last_Element
  (Self : Virtual_String_Vector'Class) return VSS.Strings.Virtual_String

Return last element of the vector.

Parameters
Self
Return Value

Length

function Length (Self : Virtual_String_Vector'Class) return Natural

Number of elements in the vector.

Parameters
Self
Return Value

Next

function Next
  (Self     : Reversible_Iterator;
   Position : Cursor) return Cursor
Parameters
Self
Position
Return Value

Prepend

procedure Prepend
  (Self : in out Virtual_String_Vector'Class;
   Item : VSS.Strings.Virtual_String'Class)

Insert given string before existing strings in the vector.

Parameters
Self
Item

Previous

function Previous
  (Self     : Reversible_Iterator;
   Position : Cursor) return Cursor
Parameters
Self
Position
Return Value

Replace

procedure Replace
  (Self  : in out Virtual_String_Vector'Class;
   Index : Positive;
   Item  : VSS.Strings.Virtual_String'Class)

Replace a string vector item with given Index by a new value.

Parameters
Self
Index
Item

Reversible_Iterator

type Reversible_Iterator is
  limited new Iterator_Interfaces.Reversible_Iterator with private;

Virtual_String_Vector

type Virtual_String_Vector is tagged private
  with
    Constant_Indexing => Element,
    Default_Iterator  => Iterate,
    Iterator_Element  => VSS.Strings.Virtual_String,
    Aggregate         => (Empty       => Empty_Virtual_String_Vector,
                          Add_Unnamed => Append_Syntax_Sugar),
    Preelaborable_Initialization;