Re: GConverter commited
- From: Shaun McCance <shaunm gnome org>
- To: Alexander Larsson <alexl redhat com>
- Cc: gtk-devel-list gnome org
- Subject: Re: GConverter commited
- Date: Mon, 23 Nov 2009 21:57:26 -0600
On Mon, 2009-11-23 at 16:30 +0100, Alexander Larsson wrote:
> I just commited GConverter to glib master (in gio). GConverter is a
> generic interface for streaming data conversion. Shipping with gio are
> converters based on iconv and zlib compression/decompression.
>
> Additionally there is GConverterInputStream and GConverterOutputStream
> for doing the conversion automatically as part of reading or writing a
> file.
>
> At the moment the compression support is just zlib, but theoretically it
> should be possible to make decompression a generic extensible thing so
> that extensions can ship other compression algorightms that are picked
> based on file sniffing. I'm not 100% sure this is all that useful
> though. And for compression its not quite possible since the exact
> parameters used for compressions vary for different compression
> algorithms.
>
> Please check out this API and give comments on it. I think its pretty
> good, as we've talked about this a bit on irc over the years, but
> feedback is always good.
Thanks. I threw together some decompressors for bzip2 and lzma.
I also cobbled together a quick magic decompressor that inspects
the first two bytes to determine what to do. Code is here:
http://www.gnome.org/~shaunm/git/convert.git
I'll be using the bzip2 and lzma converters in Yelp. I'm not
sure about the magic converter. I might just throw it away and
go off the file name. The magic detection is not suitable for
general use, though I think it's OKish for Yelp. Although this
Debian bug report concerns me:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364260
Also, when putting together chains of streams when content may
or may not be encoded, I think it would be useful to have some
sort of NullConverter, i.e. a GConverter that doesn't change
anything. Would anybody else find that useful?
Anyway, since I was one of the people wanting this, I thought
I'd share my first experiences with it. I'm curious what other
people would like to do about GConverters for other compression
schemes. The code is simple enough that I don't really mind
keeping it in Yelp. But if other people are doing this stuff,
maybe we should talk about how to share code.
Thanks again,
Shaun
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]