package GNATCOLL.WString_List_Builders is
package OS renames GNATCOLL.OS;
package UTF8 renames Ada.Strings.UTF_Encoding;
type WString_List_Builder is limited private;
-- WString_List_Builder is an efficient unbounded structure to create list
-- of strings by aggregation. The structure also allow export to **wchar
-- in C without reallocation.
procedure Append (Self : in out WString_List_Builder;
Item : UTF8.UTF_8_String);
-- Append string Item to Self.
procedure Append (Self : in out WString_List_Builder;
Other : WString_List_Builder);
-- Append builder Other to Self.
procedure Append (Self : in out WString_List_Builder; Item : Wide_String);
-- Append srtring Item to Self.
procedure Delete (Self : in out WString_List_Builder; Index : Positive);
-- Remove Index(th) element from Self.
function Length (Self : WString_List_Builder) return Natural
with Inline => True;
-- Return number of elements stored
function Element
(Self : WString_List_Builder; Index : Positive) return Wide_String
with Inline => True;
-- Return Index(th) element of the list as a string
function Element
(Self : WString_List_Builder; Index : Positive) return OS.C_WString
with Inline => True;
-- Return Index(th) element of the list as a char* C string
procedure Deallocate (Self : in out WString_List_Builder);
-- Free memory used by Self (reseting Self to the empty list).
function As_C_WString_Array
(Self : WString_List_Builder) return OS.C_WString_Array;
-- Return the address to the "char**" representation of the
-- structure.
function As_C_WString (Self : WString_List_Builder) return OS.C_WString;
-- Return the address to a block of C strings. A block consists of
-- a null-terminated block of null-terminated strings
end GNATCOLL.WString_List_Builders;