Class StringChunk

java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.glib.StringChunk
All Implemented Interfaces:
Proxy

@Generated("io.github.jwharm.JavaGI") public class StringChunk extends ProxyInstance
GStringChunk provides efficient storage of groups of strings

String chunks are used to store groups of strings. Memory is allocated in blocks, and as strings are added to the GStringChunk they are copied into the next free position in a block. When a block is full a new block is allocated.

When storing a large number of strings, string chunks are more efficient than using GLib.strdup(java.lang.String) since fewer calls to malloc() are needed, and less memory is wasted in memory allocation overheads.

By adding strings with insertConst(java.lang.String) it is also possible to remove duplicates.

To create a new GStringChunk use new_(long).

To add strings to a GStringChunk use insert(java.lang.String).

To add strings to a GStringChunk, but without duplicating strings which are already in the GStringChunk, use insertConst(java.lang.String).

To free the entire GStringChunk use free(). It is not possible to free individual strings.