Re: gnome-vfs/GIOChannel for parsing



Hi Colin,

On Wed, 2003-02-19 at 20:17, Colin Walters wrote:
> Ok, well, I did a quick port of the Mono implementation of the C# Stream
> API to GObject.  The result is here:

	:-)

> The interesting bits are in libgstream/.  It supports both file
> descriptor sources and GnomeVFS handles.  You can see how it works with
> test/gstream-cat.c.

	Ok; so it looks good enough to me, but I'd cut down some of the bulky
API method complexity. If you want people to sub-class it.

	I suggest:

enum {
	CAN_SEEK  = 0x1,
	CAN_WRITE = 0x2,
	CAN_READ  = 0x4
} Attrs;

	Attrs get_attrs (GStream *stream);

	or somesuch - a single simple method instead of three.

	I'd also look at whatever GStreamer uses for a stream API.

	I'm not convinced that read_byte belongs in the lowest level of this -
I'd do that with a chained caching sub-class that stacked on top of a
generic stream.

	Similarly, there seems to be a confusion between gsize and
GnomeVFSFileSize - eg. 'read' - why is that ? [ presumably if the API is
going to be as low down the stack as it needs to be to be useful it
should use glib types only ].

	Also - there is a reason 'write' returns the number of bytes written -
non-blocking writes ( a rather crucial feature ). In a similar vein,
some way to make the stream non-blocking is important IMHO - along with
the ability to get a fd to poll on for state changes;

> I plan to implement the TextReader/TextWriter bits next.
> 
> Comments appreciated!

	Looks nice so far. More work required though ;-)

	My feeling is still that even if you come up with a near perfect
solution, you'll be stultified at the point of actually getting it
anywhere near glib.

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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