Re: [Tracker] GInputStream wrapper for libstreamanalyzer



On Thu, 2009-02-26 at 22:13 +0100, Jos van den Oever wrote:

http://svn.gnome.org/svn/gio-strigi/trunk/

It's unfinished and untested, but:

http://svn.gnome.org/svn/gio-strigi/trunk/src/strigi-buffered-stream.cpp

The function cpp_read is something that should be tested and/or
corrected.


Hello all,

I've made a deal with Philip van Hoof. I'd implement a wrapper to use
a Strigi stream that uses a GInputStream and he'd provide the reverse.
Here is the result. The meat of the matter is tiny:

int32_t
GioInputStream::fillBuffer(char* start, int32_t space) {
    GInputStream* const g((GInputStream*)p);
    GError* error = NULL;
    gsize nread = g_input_stream_read(g, start, space, 0, &error);
    if (error != NULL) {
        m_status = Strigi::Error;
        m_error.assign(error->message);
        g_error_free(error);
        return -1;
    }
    return nread;
}

It's trivial to make such a wrapper for any io api.
It allows one to use libstreamanalyzer with a GInputStream.

Cheers,
Jos
_______________________________________________
tracker-list mailing list
tracker-list gnome org
http://mail.gnome.org/mailman/listinfo/tracker-list
-- 
Philip Van Hoof, freelance software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://pvanhoof.be/blog
http://codeminded.be




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