W Wrapl, The Programming Language

Libraries:Gtk:Glib:GString

Types

T

Constants

Nil : T

Functions

New(init @ Std.String.T) : Gtk.Glib.GString.T

Creates a new T, initialized with the given string.

init the initial text to copy into the string
Returns the new T


NewLen(init @ Std.String.T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Creates a new T with len bytes of the init buffer. Because a length is provided, init need not be nul-terminated, and can contain embedded nul bytes.

Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that init has at least len addressable bytes.

init initial contents of the string
len length of init to use
Returns a new T


SizedNew(dfl_size @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Creates a new T, with enough space for dfl_size bytes. This is useful if you are going to add a lot of text to the string and don't want it to be reallocated too often.

dfl_size the default size of the space allocated to hold the string
Returns the new T


Methods

:"="(_ @ T, _ @ T)

:AllocatedLen(self @ T) : Std.Integer.SmallT

:Append(self @ T, val @ Std.String.T) : Gtk.Glib.GString.T

Adds a string onto the end of a T, expanding it if necessary.

string a T
val the string to append onto the end of string
Returns string


:AppendC(self @ T, c @ Std.String.T) : Gtk.Glib.GString.T

Adds a byte onto the end of a T, expanding it if necessary.

string a T
c the byte to append onto the end of string
Returns string


:AppendLen(self @ T, val @ Std.String.T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

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.

string a T
val bytes to append
len number of bytes of val to use
Returns string


:AppendPrintf(self @ T, format @ Std.String.T, ... @ Std.Object.T) : Std.Object.T

Appends a formatted string onto the end of a T. This function is similar to Printf except that the text is appended to the T.

string a T
format the string format. See the printf() documentation
... the parameters to insert into the format string


:AppendUnichar(self @ T, wc @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Converts a Unicode character into UTF-8, and appends it to the string.

string a T
wc a Unicode character
Returns string


:AppendUriEscaped(self @ T, unescaped @ Std.String.T, reserved_chars_allowed @ Std.String.T, allow_utf8 @ Std.Symbol.T) : Gtk.Glib.GString.T

Appends unescaped to string, escaped any characters that are reserved in URIs using URI-style escape sequences.

string a T
unescaped a string
reserved_chars_allowed a string of reserved characters allowed to be used, or NULL
allow_utf8 set TRUE if the escaped string may include UTF8 characters
Returns string


:AppendVprintf(self @ T, format @ Std.String.T, args @ Agg.List.T) : Std.Object.T

Appends a formatted string onto the end of a T. This function is similar to AppendPrintf except that the arguments to the format string are passed as a va_list.

string a T
format the string format. See the printf() documentation
args the list of arguments to insert in the output


:AsciiDown(self @ T) : Gtk.Glib.GString.T

Converts all upper case ASCII letters to lower case ASCII letters.

string a GString
Returns passed-in string pointer, with all the upper case characters converted to lower case in place, with semantics that exactly match Gtk.Glib.GStrfuncs.AsciiTolower.


:AsciiUp(self @ T) : Gtk.Glib.GString.T

Converts all lower case ASCII letters to upper case ASCII letters.

string a GString
Returns passed-in string pointer, with all the lower case characters converted to upper case in place, with semantics that exactly match Gtk.Glib.GStrfuncs.AsciiToupper.


:Assign(self @ T, rval @ Std.String.T) : Gtk.Glib.GString.T

Copies the bytes from a string into a T, 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.

string the destination T. Its current contents are destroyed.
rval the string to copy into string
Returns string


:Down(self @ T) : Gtk.Glib.GString.T

Warning

Down has been deprecated since version 2.2 and should not be used in newly-written code. This function uses the locale-specific tolower() function, which is almost never the right thing. Use AsciiDown or Gtk.Glib.GUnicode.Utf8Strdown instead.



:Equal(self @ T, v2 @ Gtk.Glib.GString.T) : Std.Symbol.T

Compares two strings for equality, returning TRUE if they are equal. For use with Gtk.Glib.GHashTable.T.

v a T
v2 another T
Returns TRUE if they strings are the same length and contain the same bytes


:Erase(self @ T, pos @ Std.Integer.SmallT, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Removes len bytes from a T, starting at position pos. The rest of the T is shifted down to fill the gap.

string a T
pos the position of the content to remove
len the number of bytes to remove, or -1 to remove all following bytes
Returns string


:Free(self @ T, free_segment @ Std.Symbol.T) : Std.String.T

Frees the memory allocated for the T. 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().

string a T
free_segment if TRUE the actual character data is freed as well
Returns the character data of string (i.e. NULL if free_segment is TRUE)


:Hash(self @ T) : Std.Integer.SmallT

Creates a hash code for str; for use with Gtk.Glib.GHashTable.T.

str a string to hash
Returns hash code for str


:Insert(self @ T, pos @ Std.Integer.SmallT, val @ Std.String.T) : Gtk.Glib.GString.T

Inserts a copy of a string into a T, expanding it if necessary.

string a T
pos the position to insert the copy of the string
val the string to insert
Returns string


:InsertC(self @ T, pos @ Std.Integer.SmallT, c @ Std.String.T) : Gtk.Glib.GString.T

Inserts a byte into a T, expanding it if necessary.

string a T
pos the position to insert the byte
c the byte to insert
Returns string


:InsertLen(self @ T, pos @ Std.Integer.SmallT, val @ Std.String.T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

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.

string a T
pos position in string where insertion should happen, or -1 for at the end
val bytes to insert
len number of bytes of val to insert
Returns string


:InsertUnichar(self @ T, pos @ Std.Integer.SmallT, wc @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Converts a Unicode character into UTF-8, and insert it into the string at the given position.

string a T
pos the position at which to insert character, or -1 to append at the end of the string
wc a Unicode character
Returns string


:Len(self @ T) : Std.Integer.SmallT

:Overwrite(self @ T, pos @ Std.Integer.SmallT, val @ Std.String.T) : Gtk.Glib.GString.T

Overwrites part of a string, lengthening it if necessary.

string a T
pos the position at which to start overwriting
val the string that will overwrite the string starting at pos
Returns string


:OverwriteLen(self @ T, pos @ Std.Integer.SmallT, val @ Std.String.T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Overwrites part of a string, lengthening it if necessary. This function will work with embedded nuls.

string a T
pos the position at which to start overwriting
val the string that will overwrite the string starting at pos
len the number of bytes to write from val
Returns string


:Prepend(self @ T, val @ Std.String.T) : Gtk.Glib.GString.T

Adds a string on to the start of a T, expanding it if necessary.

string a T
val the string to prepend on the start of string
Returns string


:PrependC(self @ T, c @ Std.String.T) : Gtk.Glib.GString.T

Adds a byte onto the start of a T, expanding it if necessary.

string a T
c the byte to prepend on the start of the T
Returns string


:PrependLen(self @ T, val @ Std.String.T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

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.

string a T
val bytes to prepend
len number of bytes in val to prepend
Returns string


:PrependUnichar(self @ T, wc @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Converts a Unicode character into UTF-8, and prepends it to the string.

string a T
wc a Unicode character
Returns string


:Printf(self @ T, format @ Std.String.T, ... @ Std.Object.T) : Std.Object.T

Writes a formatted string into a T. This is similar to the standard sprintf() function, except that the T buffer automatically expands to contain the results. The previous contents of the T are destroyed.

string a T
format the string format. See the printf() documentation
... the parameters to insert into the format string


:SetSize(self @ T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Sets the length of a T. 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.)

string a T
len the new length
Returns string


:Str(self @ T) : Std.String.T

:Truncate(self @ T, len @ Std.Integer.SmallT) : Gtk.Glib.GString.T

Cuts off the end of the GString, leaving the first len bytes.

string a T
len the new size of string
Returns string


:Up(self @ T) : Gtk.Glib.GString.T

Warning

Up has been deprecated since version 2.2 and should not be used in newly-written code. This function uses the locale-specific toupper() function, which is almost never the right thing. Use AsciiUp or Gtk.Glib.GUnicode.Utf8Strup instead.



:Vprintf(self @ T, format @ Std.String.T, args @ Agg.List.T) : Std.Object.T

Writes a formatted string into a T. This function is similar to Printf except that the arguments to the format string are passed as a va_list.

string a T
format the string format. See the printf() documentation
args the parameters to insert into the format string


:setAllocatedLen(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setLen(self @ T, value @ Std.Integer.SmallT) : Std.Integer.SmallT

:setStr(self @ T, value @ Std.String.T) : Std.String.T

:"~="(_ @ T, _ @ T)