VSS.Strings

Entities

Simple Types

Array Types

Tagged Types

Subtypes

Constants

Subprograms

Description

API to process string data as sequences of Unicode Code Points.

"&"

function "&"
  (Left  : VSS.Characters.Virtual_Character;
   Right : Virtual_String) return Virtual_String

Concatenation operator for virtual string and virtual characters.

Parameters
Left
Right
Return Value

"&"

function "&"
  (Left  : Virtual_String;
   Right : VSS.Characters.Virtual_Character) return Virtual_String

Concatenation operator for virtual string and virtual characters.

Parameters
Left
Right
Return Value

"&"

function "&"
  (Left  : Virtual_String;
   Right : Virtual_String) return Virtual_String

Concatenation operator for virtual string and virtual characters.

Parameters
Left
Right
Return Value

"*"

function "*"
  (Left  : Character_Count;
   Right : VSS.Characters.Virtual_Character) return Virtual_String

Create string by repeating given number of given character.

Parameters
Left
Right
Return Value

"<"

function "<"
  (Left  : Virtual_String;
   Right : Virtual_String) return Boolean

Compare two strings in binary order of code points.

Parameters
Left
Right
Return Value

"<="

function "<="
  (Left  : Virtual_String;
   Right : Virtual_String) return Boolean

Compare two strings in binary order of code points.

Parameters
Left
Right
Return Value

"="

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

Compare two strings in binary order of code points.

Parameters
Left
Right
Return Value

">"

function ">"
  (Left  : Virtual_String;
   Right : Virtual_String) return Boolean

Compare two strings in binary order of code points.

Parameters
Left
Right
Return Value

">="

function ">="
  (Left  : Virtual_String;
   Right : Virtual_String) return Boolean

Compare two strings in binary order of code points.

Parameters
Left
Right
Return Value

After_Last_Character

function After_Last_Character
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Characters.Character_Iterator

Return iterator pointing after the last character of the string.

Parameters
Self
Return Value

After_Last_Grapheme_Cluster

function After_Last_Grapheme_Cluster
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Grapheme_Clusters
            .Grapheme_Cluster_Iterator

Return iterator pointing after the last grapheme cluster of the string.

Parameters
Self
Return Value

After_Last_Word

function After_Last_Word
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Words.Word_Iterator

Return iterator pointing after the last word of the string.

Parameters
Self
Return Value

Append

procedure Append
  (Self : in out Virtual_String'Class;
   Item : VSS.Characters.Virtual_Character)

Append given abstract character to the end of the string.

Parameters
Self
Item

Append

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

Append another string to the end of the string.

Parameters
Self
Item

At_Character

function At_Character
  (Self     : Virtual_String'Class;
   Position : VSS.Strings.Cursors.Abstract_Character_Cursor'Class)
   return VSS.Strings.Cursors.Iterators.Characters.Character_Iterator

Return iterator pointing to the character at given position. Cursor must belong to the same string.

Parameters
Self
Position
Return Value

At_First_Character

function At_First_Character
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Characters.Character_Iterator

Return iterator pointing to the first character of the string.

Parameters
Self
Return Value

At_First_Grapheme_Cluster

function At_First_Grapheme_Cluster
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Grapheme_Clusters
            .Grapheme_Cluster_Iterator

Return iterator pointing to the first grapheme cluster of the string.

Parameters
Self
Return Value

At_First_Line

function At_First_Line
  (Self            : Virtual_String'Class;
   Terminators     : Line_Terminator_Set := New_Line_Function;
   Keep_Terminator : Boolean := False)
   return VSS.Strings.Cursors.Iterators.Lines.Line_Iterator

Return iterator pointing to the first logical line of the string.

Parameters
Self
Terminators
Keep_Terminator
Return Value

At_First_Word

function At_First_Word
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Words.Word_Iterator

Return iterator pointing to the first word of the string.

Parameters
Self
Return Value

At_Grapheme_Cluster

function At_Grapheme_Cluster
  (Self     : Virtual_String'Class;
   Position : VSS.Strings.Cursors.Abstract_Character_Cursor'Class)
   return VSS.Strings.Cursors.Iterators.Grapheme_Clusters
            .Grapheme_Cluster_Iterator

Return iterator pointing to the grapheme cluster of the string at the given position.

Parameters
Self
Position
Return Value

At_Last_Character

function At_Last_Character
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Characters.Character_Iterator

Return iterator pointing to the last character of the string.

Parameters
Self
Return Value

At_Last_Grapheme_Cluster

function At_Last_Grapheme_Cluster
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Grapheme_Clusters
            .Grapheme_Cluster_Iterator

Return iterator pointing to the last grapheme cluster of the string.

Parameters
Self
Return Value

At_Last_Word

function At_Last_Word
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Words.Word_Iterator

Return iterator pointing to the last word of the string.

Parameters
Self
Return Value

At_Line

function At_Line
  (Self            : Virtual_String'Class;
   Position        : VSS.Strings.Cursors.Abstract_Character_Cursor'Class;
   Terminators     : Line_Terminator_Set := New_Line_Function;
   Keep_Terminator : Boolean := False)
   return VSS.Strings.Cursors.Iterators.Lines.Line_Iterator

Return iterator pointing to the line at given position.

Parameters
Self
Position
Terminators
Keep_Terminator
Return Value

At_Word

function At_Word
  (Self     : Virtual_String'Class;
   Position : VSS.Strings.Cursors.Abstract_Character_Cursor'Class)
   return VSS.Strings.Cursors.Iterators.Words.Word_Iterator

Return iterator pointing to the word of the string at the given position.

Parameters
Self
Position
Return Value

Before_First_Character

function Before_First_Character
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Characters.Character_Iterator

Return iterator pointing before the first character of the string.

Parameters
Self
Return Value

Before_First_Grapheme_Cluster

function Before_First_Grapheme_Cluster
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Grapheme_Clusters
            .Grapheme_Cluster_Iterator

Return iterator pointing before the first grapheme cluster of the string.

Parameters
Self
Return Value

Before_First_Word

function Before_First_Word
  (Self : Virtual_String'Class)
   return VSS.Strings.Cursors.Iterators.Words.Word_Iterator

Return iterator pointing before the first word of the string.

Parameters
Self
Return Value

Case_Sensitivity

type Case_Sensitivity is
  (Case_Sensitive,
   Default_Caseless,
   Canonical_Caseless,
   Compatibility_Caseless,
   Identifier_Caseless);
Enumeration Literal
Case_Sensitive

Simple binary search.

Default_Caseless

Full case folding without normalization.

Canonical_Caseless

Full case folding & canonical decomposition.

Compatibility_Caseless

Full case folding & compatibility decomposition.

Identifier_Caseless

Full case folding, compatibility composition & ignore any characters with Default_Ignorable_Code_Point property set to True. Suitable to compare identifiers.

Character_Count

type Character_Count is range 0 .. 2 ** 30 - 1;

Character_Index

subtype Character_Index is Character_Count range 1 .. Character_Count'Last;

Character_Length

function Character_Length
  (Self : Virtual_String'Class) return Character_Count

Return number of characters.

Parameters
Self
Return Value

Clear

procedure Clear (Self : in out Virtual_String'Class)

Remove all data.

Parameters
Self

Column_Count

type Column_Count is new Grapheme_Cluster_Count;

Column_Index

subtype Column_Index is Column_Count range 1 .. Column_Count'Last;

Delete

procedure Delete
  (Self : in out Virtual_String'Class;
   From : VSS.Strings.Cursors.Abstract_Cursor'Class;
   To   : VSS.Strings.Cursors.Abstract_Cursor'Class)

procedure Remove (Self : in out Virtual_String'Class; From_To : VSS.Strings.Cursors.Abstract_Cursor'Class); Delete characters from of the string starting from given position to given position.

Parameters
Self
From
To

Empty_Virtual_String

Empty_Virtual_String : constant Virtual_String;

Ends_With

function Ends_With
  (Self   : Virtual_String'Class;
   Suffix : VSS.Characters.Virtual_Character) return Boolean

Return True when Self has given Suffix.

Parameters
Self
Suffix
Return Value

Ends_With

function Ends_With
  (Self : Virtual_String'Class; Suffix : Line_Terminator) return Boolean

Return True when Self has given Suffix.

Parameters
Self
Suffix
Return Value

Ends_With

function Ends_With
  (Self   : Virtual_String'Class;
   Suffix : Line_Terminator_Set) return Boolean

Return True when Self has given Suffix.

Parameters
Self
Suffix
Return Value

Ends_With

function Ends_With
  (Self             : Virtual_String'Class;
   Suffix           : Virtual_String'Class;
   Case_Sensitivity : VSS.Strings.Case_Sensitivity := Case_Sensitive)
   return Boolean

Return True when Self has given Suffix. Case_Sensitivity defines whether search is case sensitive or not, and select algorithm for the last.

Parameters
Self
Suffix
Case_Sensitivity
Return Value

Grapheme_Cluster_Count

type Grapheme_Cluster_Count is range 0 .. 2 ** 30 - 1;

Grapheme_Cluster_Index

subtype Grapheme_Cluster_Index is Grapheme_Cluster_Count
  range 1 .. Grapheme_Cluster_Count'Last;

Hash

function Hash (Self : Virtual_String'Class) return Hash_Type

Return hash value for the given string.

Parameters
Self
Return Value

Hash_Type

type Hash_Type is mod 2**64;

Head_Before

function Head_Before
  (Self   : Virtual_String'Class;
   Before : VSS.Strings.Cursors.Abstract_Cursor'Class)
   return Virtual_String

Return head of the string before given position.

Parameters
Self
Before
Return Value

Insert

procedure Insert
  (Self     : in out Virtual_String'Class;
   Position : VSS.Strings.Cursors.Abstract_Cursor'Class;
   Item     : VSS.Characters.Virtual_Character)

Inserts given item at the given position. Do nothing if the given position is invalid.

Parameters
Self
Position
Item

Insert

procedure Insert
  (Self     : in out Virtual_String'Class;
   Position : VSS.Strings.Cursors.Abstract_Cursor'Class;
   Item     : Virtual_String'Class)

Inserts given item at the given position. Do nothing if the given position is invalid.

Parameters
Self
Position
Item

Is_Empty

function Is_Empty (Self : Virtual_String'Class) return Boolean

Return True when string is empty string: it is ether null or has zero length.

Parameters
Self
Return Value

Is_Null

function Is_Null (Self : Virtual_String'Class) return Boolean

Return True when string is null.

Parameters
Self
Return Value

Line_Count

type Line_Count is new Natural;

Line_Index

subtype Line_Index is Line_Count range 1 .. Line_Count'Last;

Line_Terminator

type Line_Terminator is (CR, LF, CRLF, NEL, VT, FF, LS, PS);
Enumeration Literal
CR
LF
CRLF
NEL
VT
FF
LS
PS

Line_Terminator_Set

type Line_Terminator_Set is array (Line_Terminator) of Boolean
  with Pack, Default_Component_Value => False;

New_Line_Function

New_Line_Function : constant Line_Terminator_Set :=
  [CR | LF | CRLF | NEL => True, others => False];

Normalization_Form

type Normalization_Form is
  (Normalization_Form_D,
   Normalization_Form_C,
   Normalization_Form_KD,
   Normalization_Form_KC);
Enumeration Literal
Normalization_Form_D
Normalization_Form_C
Normalization_Form_KD
Normalization_Form_KC

Prepend

procedure Prepend
  (Self : in out Virtual_String'Class;
   Item : VSS.Characters.Virtual_Character)

Prepend given character to the begin of the string.

Parameters
Self
Item

Prepend

procedure Prepend
  (Self : in out Virtual_String'Class;
   Item : Virtual_String'Class)

Prepend given string to the begin of the string.

Parameters
Self
Item

Replace

procedure Replace
  (Self : in out Virtual_String'Class;
   From : VSS.Strings.Cursors.Abstract_Cursor'Class;
   To   : VSS.Strings.Cursors.Abstract_Cursor'Class;
   By   : VSS.Characters.Virtual_Character)

procedure Replace (Self : in out Virtual_String'Class; From_To : VSS.Strings.Cursors.Abstract_Cursor'Class; By : VSS.Characters.Virtual_Character);

Parameters
Self
From
To
By

Replace

procedure Replace
  (Self : in out Virtual_String'Class;
   From : VSS.Strings.Cursors.Abstract_Cursor'Class;
   To   : VSS.Strings.Cursors.Abstract_Cursor'Class;
   By   : Virtual_String'Class)

procedure Replace (Self : in out Virtual_String'Class; From_To : VSS.Strings.Cursors.Abstract_Cursor'Class; By : Virtual_String'Class); Replace slice from and to given positions by given item.

Parameters
Self
From
To
By

Slice

function Slice
  (Self    : Virtual_String'Class;
   Segment : VSS.Strings.Cursors.Abstract_Cursor'Class)
   return Virtual_String

Returns slice of the string. Return "null" string when one of cursors doesn't belong to given string or invalid cursors.

Parameters
Self
Segment
Return Value

Slice

function Slice
  (Self : Virtual_String'Class;
   From : VSS.Strings.Cursors.Abstract_Cursor'Class;
   To   : VSS.Strings.Cursors.Abstract_Cursor'Class)
   return Virtual_String

Returns slice of the string. Return "null" string when one of cursors doesn't belong to given string or invalid cursors.

Parameters
Self
From
To
Return Value

Split

function Split
  (Self                : Virtual_String'Class;
   Separator           : VSS.Characters.Virtual_Character;
   Keep_Empty_Segments : Boolean                      := True;
   Case_Sensitivity    : VSS.Strings.Case_Sensitivity := Case_Sensitive)
   return VSS.String_Vectors.Virtual_String_Vector

Split the string into substrings where separator occurs and return list of those strings.

Parameters
Self
Separator
Keep_Empty_Segments
Case_Sensitivity
Return Value

Split_Lines

function Split_Lines
  (Self            : Virtual_String'Class;
   Terminators     : Line_Terminator_Set := New_Line_Function;
   Keep_Terminator : Boolean := False)
   return VSS.String_Vectors.Virtual_String_Vector
Parameters
Self
Terminators
Keep_Terminator
Return Value

Starts_With

function Starts_With
  (Self             : Virtual_String'Class;
   Prefix           : Virtual_String'Class;
   Case_Sensitivity : VSS.Strings.Case_Sensitivity := Case_Sensitive)
   return Boolean

Return True when Self starts with Prefix. Case_Sensitivity defines whether search is case sensitive or not, and select algorithm for the last.

Parameters
Self
Prefix
Case_Sensitivity
Return Value

Tail_After

function Tail_After
  (Self  : Virtual_String'Class;
   After : VSS.Strings.Cursors.Abstract_Cursor'Class) return Virtual_String

Return tail of the string starting from the first character after given position.

Parameters
Self
After
Return Value

Tail_From

function Tail_From
  (Self : Virtual_String'Class;
   From : VSS.Strings.Cursors.Abstract_Cursor'Class) return Virtual_String

Return tail of the string starting from the given position.

Parameters
Self
From
Return Value

To_Lowercase

function To_Lowercase (Self : Virtual_String'Class) return Virtual_String

Convert string to lowercase form using default full case conversion.

See VSS.Locales.To_Lowercase for case conversions with tailoring by the locale.

Parameters
Self
Return Value

To_Normalized

function To_Normalized
  (Self : Virtual_String'Class;
   Form : Normalization_Form) return Virtual_String

Convert string to given normalization form.

Parameters
Self
Form
Return Value

To_Simple_Lowercase

function To_Simple_Lowercase
  (Self : Virtual_String'Class) return Virtual_String

Convert string to lowercase form using default simple case conversion.

Parameters
Self
Return Value

To_Simple_Uppercase

function To_Simple_Uppercase
  (Self : Virtual_String'Class) return Virtual_String

Convert string to uppercase form using default simple case conversion.

Parameters
Self
Return Value

To_Uppercase

function To_Uppercase (Self : Virtual_String'Class) return Virtual_String

Convert string to uppercase form using default full case conversion.

See VSS.Locales.To_Uppercase for case conversions with tailoring by the locale.

Parameters
Self
Return Value

To_Virtual_String

function To_Virtual_String (Item : Wide_Wide_String) return Virtual_String

Convert given string into virtual string.

Parameters
Item
Return Value

Virtual_String

type Virtual_String is tagged private
  with String_Literal => To_Virtual_String;