Re: Handling long SVG strings in Path



On Mon, 2009-05-04 at 11:36 -0500, Jamie Lahowetz wrote:
> I am new to C and am trying to translate a Perl program I wrote over
> to C. The program displays shapefiles using the path call in goocanvas
> and utilizes svg to make them look right. The strings that the
> shapefiles generate can be 1million+ characters in size so they are
> very large. My question is, what is the best way to handle such a
> large string in C and insert it into path? Thanks.

You could just use g_file_get_contents() and read it all in in one go,
then free it when you've parsed it. Though it may be safer to use
fopen() and fread() to parse a bit at a time. (Or the new g_file_read()
and GInputStream functions in GIO.)

Note that GooCanvasPath is only intended to be used for reasonably small
paths. So break your shapefiles into pieces if you can.

Damon




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