StringBuilder
Object Hierarchy:
Description:
[ Compact ]
public class StringBuilder
The GString struct contains the public fields of a GString.
Content:
Properties:
Static methods:
- public static Bytes free_to_bytes (StringBuilder str)
Transfers ownership of the contents of this
to a newly allocated Bytes.
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
this.
- 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
this.
- 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_len (ssize_t pos, string val, ssize_t len)
Inserts len
bytes of val
into
this at pos
.
- 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 overwrite (size_t pos, string val)
Overwrites part of a string, lengthening it if necessary.
- public unowned StringBuilder overwrite_len (size_t pos, string val, ssize_t len)
Overwrites part of a string, lengthening it if necessary.
- public unowned StringBuilder erase (ssize_t pos = 0, ssize_t len = -1)
Removes len
bytes from a
StringBuilder, starting at position pos
.
- public unowned StringBuilder truncate (size_t len = 0)
Cuts off the end of the GString, leaving the first len
bytes.
- public void printf (string format, ...)
Writes a formatted string into a StringBuilder
.
- public void append_printf (string format, ...)
Appends a formatted string onto the end of a
StringBuilder.
- public void vprintf (string format, va_list args)
Writes a formatted string into a StringBuilder
.
- public void append_vprintf (string format, va_list args)
Appends a formatted string onto the end of a
StringBuilder.
Fields: