| ZIF Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
ZifString; #define zif_string_get_value (string) ZifString * zif_string_new (const gchar *value); ZifString * zif_string_new_static (const gchar *value); ZifString * zif_string_new_value (gchar *value); ZifString * zif_string_ref (ZifString *string); ZifString * zif_string_unref (ZifString *string);
To avoid frequent malloc/free, we use reference counted strings to optimise many of the zif internals.
ZifString * zif_string_new (const gchar *value);
Creates a new referenced counted string
|
string to copy |
Returns : |
New allocated string |
Since 0.1.0
ZifString * zif_string_new_static (const gchar *value);
Creates a new referenced counted string, using the static memory. You MUST not free the static string that backs this object. Use this function with care.
|
string to use |
Returns : |
New allocated string |
Since 0.1.3
ZifString * zif_string_new_value (gchar *value);
Creates a new referenced counted string, using the allocated memory.
Do not free value as it is now owned by the ZifString.
|
string to use |
Returns : |
New allocated string |
Since 0.1.0
ZifString * zif_string_ref (ZifString *string);
Increases the reference count on the object.
Since 0.1.0