The GString struct contains the public fields of a GString.
function Append (Self : Gstring; Val : UTF8_String) return Gstring
Adds a string onto the end of a Glib.String.Gstring, expanding it if necessary.
the string to append onto the end of String
String
function Append_C (Self : Gstring; C : Gchar) return Gstring
Adds a byte onto the end of a Glib.String.Gstring, expanding it if necessary.
the byte to append onto the end of String
String
function Append_Len
(Self : Gstring;
Val : UTF8_String;
Len : Gssize) return Gstring
Appends Len bytes of Val to String. Because Len is provided, Val may contain embedded nuls and need not be nul-terminated. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that Val has at least Len addressable bytes.
bytes to append
number of bytes of Val to use
String
function Append_Unichar (Self : Gstring; Wc : Gunichar) return Gstring
Converts a Unicode character into UTF-8, and appends it to the string.
a Unicode character
String
function Append_Uri_Escaped
(Self : Gstring;
Unescaped : UTF8_String;
Reserved_Chars_Allowed : UTF8_String;
Allow_Utf8 : Boolean) return Gstring
Appends Unescaped to String, escaped any characters that are reserved in URIs using URI-style escape sequences. Since: gtk+ 2.16
a string
a string of reserved characters allowed to be used, or null
set True if the escaped string may include UTF8 characters
String
function Ascii_Down (Self : Gstring) return Gstring
Converts all uppercase ASCII letters to lowercase ASCII letters.
passed-in String pointer, with all the uppercase characters converted to lowercase in place, with semantics that exactly match g_ascii_tolower.
function Ascii_Up (Self : Gstring) return Gstring
Converts all lowercase ASCII letters to uppercase ASCII letters.
passed-in String pointer, with all the lowercase characters converted to uppercase in place, with semantics that exactly match g_ascii_toupper.
function Assign (Self : Gstring; Rval : UTF8_String) return Gstring
Copies the bytes from a string into a Glib.String.Gstring, destroying any previous contents. It is rather like the standard strcpy function, except that you do not have to worry about having enough space to copy the string.
the string to copy into String
String
function Down (Self : Gstring) return Gstring
Converts a Glib.String.Gstring to lowercase. Deprecated since 2.2, 1
the Glib.String.Gstring
function Equal (Self : Gstring; V2 : Gstring) return Boolean
Compares two strings for equality, returning True if they are equal. For use with GHash_Table.
another Glib.String.Gstring
True if the strings are the same length and contain the same bytes
function Erase
(Self : Gstring;
Pos : Gssize;
Len : Gssize) return Gstring
Removes Len bytes from a Glib.String.Gstring, starting at position Pos. The rest of the Glib.String.Gstring is shifted down to fill the gap.
the position of the content to remove
the number of bytes to remove, or -1 to remove all following bytes
String
function Free (Self : Gstring; Free_Segment : Boolean) return UTF8_String
Frees the memory allocated for the Glib.String.Gstring. If Free_Segment is True it also frees the character data. If it's False, the caller gains ownership of the buffer and must free it after use with g_free.
if True, the actual character data is freed as well
the character data of String (i.e. null if Free_Segment is True)
function From_Object_Free (B : access Gstring) return Gstring
The GString struct contains the public fields of a GString.
function Get_Type return Glib.GType
type Gstring is record
Str : Gtkada.Types.Chars_Ptr;
Len : Gsize;
Allocated_Len : Gsize;
end record;
function Hash (Self : Gstring) return Guint
Creates a hash code for Str; for use with GHash_Table.
hash code for Str
function Insert
(Self : Gstring;
Pos : Gssize;
Val : UTF8_String) return Gstring
Inserts a copy of a string into a Glib.String.Gstring, expanding it if necessary.
the position to insert the copy of the string
the string to insert
String
function Insert_C
(Self : Gstring;
Pos : Gssize;
C : Gchar) return Gstring
Inserts a byte into a Glib.String.Gstring, expanding it if necessary.
the position to insert the byte
the byte to insert
String
function Insert_Len
(Self : Gstring;
Pos : Gssize;
Val : UTF8_String;
Len : Gssize) return Gstring
Inserts Len bytes of Val into String at Pos. Because Len is provided, Val may contain embedded nuls and need not be nul-terminated. If Pos is -1, bytes are inserted at the end of the string. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that Val has at least Len addressable bytes.
position in String where insertion should happen, or -1 for at the end
bytes to insert
number of bytes of Val to insert
String
function Insert_Unichar
(Self : Gstring;
Pos : Gssize;
Wc : Gunichar) return Gstring
Converts a Unicode character into UTF-8, and insert it into the string at the given position.
the position at which to insert character, or -1 to append at the end of the string
a Unicode character
String
function Overwrite
(Self : Gstring;
Pos : Gsize;
Val : UTF8_String) return Gstring
Overwrites part of a string, lengthening it if necessary. Since: gtk+ 2.14
the position at which to start overwriting
the string that will overwrite the String starting at Pos
String
function Overwrite_Len
(Self : Gstring;
Pos : Gsize;
Val : UTF8_String;
Len : Gssize) return Gstring
Overwrites part of a string, lengthening it if necessary. This function will work with embedded nuls. Since: gtk+ 2.14
the position at which to start overwriting
the string that will overwrite the String starting at Pos
the number of bytes to write from Val
String
function Prepend (Self : Gstring; Val : UTF8_String) return Gstring
Adds a string on to the start of a Glib.String.Gstring, expanding it if necessary.
the string to prepend on the start of String
String
function Prepend_C (Self : Gstring; C : Gchar) return Gstring
Adds a byte onto the start of a Glib.String.Gstring, expanding it if necessary.
the byte to prepend on the start of the Glib.String.Gstring
String
function Prepend_Len
(Self : Gstring;
Val : UTF8_String;
Len : Gssize) return Gstring
Prepends Len bytes of Val to String. Because Len is provided, Val may contain embedded nuls and need not be nul-terminated. Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that Val has at least Len addressable bytes.
bytes to prepend
number of bytes in Val to prepend
String
function Prepend_Unichar (Self : Gstring; Wc : Gunichar) return Gstring
Converts a Unicode character into UTF-8, and prepends it to the string.
a Unicode character
String
function Set_Size (Self : Gstring; Len : Gsize) return Gstring
Sets the length of a Glib.String.Gstring. If the length is less than the current length, the string will be truncated. If the length is greater than the current length, the contents of the newly added area are undefined. (However, as always, string->str[string->len] will be a nul byte.)
the new length
String
function Truncate (Self : Gstring; Len : Gsize) return Gstring
Cuts off the end of the GString, leaving the first Len bytes.
the new size of String
String
function Up (Self : Gstring) return Gstring
Converts a Glib.String.Gstring to uppercase. Deprecated since 2.2, 1
String