StringBuilder
Object Hierarchy:
Description:
public class StringBuilder
A StringBuilder is an object that handles the memory management of a C string for
you.
In addition to the string itself, StringBuilder stores the length of the string, so
can be used for binary data with embedded nul bytes. To access the C string managed by the
StringBuilder string, simply use
StringBuilder.str.
Namespace: GLib
Package: glib-2.0
Content:
Creation methods:
Methods:
-
public unowned StringBuilder assign (string rval)
Copies the bytes from a string into a StringBuilder,
destroying any previous contents.
-
public unowned StringBuilder append (string val)
Adds a string onto the end of a StringBuilder,
expanding it if necessary.
-
public unowned StringBuilder append_c (char c)
Adds a byte onto the end of a StringBuilder,
expanding it if necessary.
-
public unowned StringBuilder append_unichar (unichar wc)
Converts a Unicode character into UTF-8, and appends it to the string.
-
public unowned StringBuilder append_len (string val, ssize_t len)
Appends len bytes of val to string.
-
public unowned StringBuilder prepend (string val)
Adds a string on to the start of a StringBuilder,
expanding it if necessary.
-
public unowned StringBuilder prepend_c (char c)
Adds a byte onto the start of a StringBuilder,
expanding it if necessary.
-
public unowned StringBuilder prepend_unichar (unichar wc)
Converts a Unicode character into UTF-8, and prepends it to the string.
-
public unowned StringBuilder prepend_len (string val, ssize_t len)
Prepends len bytes of val to string. Because len is provided, val may contain embedded nuls and need not
be nul-terminated.
-
public unowned StringBuilder insert (ssize_t pos, string val)
Inserts a copy of a string into a StringBuilder,
expanding it if necessary.
-
public unowned StringBuilder insert_unichar (ssize_t pos, unichar wc)
Converts a Unicode character into UTF-8, and insert it into the string at the given position.
-
public unowned StringBuilder erase (ssize_t pos = 0, ssize_t len = -1)
-
public unowned StringBuilder truncate (size_t len = 0)
Cuts off the end of the StringBuilder, leaving the
first len bytes.
-
public void printf (string format, ...)
-
public void append_printf (string format, ...)
-
public void vprintf (string format, va_list args)
-
public void append_vprintf (string format, va_list args)
Fields: