
Hi, all.
Today I added the /src/io dir to the automake tree. It has some new interfaces and implementations whose purpose is to make it easier to read and write streams of data.
Basically they are lightly based on java's input and output streams and readers and writers, and -not- on iostreams, which turned out to be too much of a burden for too little benefit. It is intended that they can be subclassed and/or chained together to get the desired effect.
Also, they encourage people to use Inkscape::URI's instead of char *filenames and FILE *. This has been discussed for months for the purpose of referring to resources, but has been slow in appearing.
These two are based on bytes (unsigned char) ================================= InputStream -- reads unformatted (aka binary) data OutputStream -- writes unformatted data
These are for formatted unicode IO (gunichar and Glib::ustring) ============================= Reader -- formatted (aka text) data input like stream >> data; Writer -- formatted output like stream << data. Also has a printf() InputStreamReader -- uses an inputstream as its source OutputStreamWriter -- uses an outputstream as its destination
So far there are =========== (these need to be filled out, but work for files now) UriInputStream --reads data from an Inkscape::URI UriOutputStream -- writes data to an Inkscape::URI
need to be implemented: ----------------------------- UriReader UriWriter
These work in the tests: ================= XsltInputStream XsltOutputStream GzipInputStream GzipOutputStream StringInputStream StringOutputStream
These need to be fleshed out and tweaked, but basically they are usable already.
I need to run to an appointment, so I'm making this brief. I just wanted people to know that this is available.
Bob