Re: [p: what's the deal with string chunks?]



On Friday 28 December 2001 2:02, Peter Jay Salzman wrote:
> i'm totally confused.   i need a way of temporarily storing a bunch of
> strings.  i was using a g_array, but that was getting pretty hairy.
> then i found GStringChunks.  but:
>
> the glib reference shows how to:
>
>   declare a GStringChunk
>   add a GString to a GStringChunk
>   free a GStringChunk
>
> the reference guide makes no mention of how to access the GStrings in
> the GString chunk.
>
> how does one access the GStrings that you put into a GStringChunk?
You get a pointer to it when you add it. You must save that pointer
if you'd like to use the string later.
a GStringChunk is not for accessing strings, its for storing them in
an efficient matter, and for the ease of destroying a group of
strings later..



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]