Re: xp stat needed


Subject: Re: xp stat needed
From: Mike Nordell (tamlin@algonet.se)
Date: Tue Nov 13 2001 - 01:53:51 CST


|Lots of good stuff snipped|

One question that comes to mind is:
    Do we really need a "file"?

Isn't what we really need streams? Input streams and output streams, and
until we really need it (if ever) I'd vote for no combined iostream. That
would AFAIK take care of all of our needs.

Input could then come from e.g. memory, TCP, UDP (hehe, multicast an AbiWord
document?), disk file, whatever...

The same for output.

Then, since we aren't using templates, we could possibly create a streambuf
replacement interface, that instead of compile-time template deduction used
some kind of streambuf interface (using only virtual member functions - a
little slower and a little larger, but in this case probably acceptable)
that the istream/ostream gets (from the factory) at construction. Something
like:

UT_Istream* createFileIStream(const char* szFilename)
{
    UT_IStreambuf* pStream = new FileIStreambuf(szFilename);
    return new UT_IStream(pStream);
}

The streambuf would, even that it poses as a stream, know how large the
"real" file is (as part of parsing HTTP headers, asking the local
filesystem, or by whatever means are possible) and a function
    virtual UT_uint32 streamSize() const;

that the Istream interface can forward stream size, requests from the
client, to.

or am I getting carried away again? :-)

(is this starting to look like an alternative std::<whatever>
implementation?)

/Mike - please don't cc



This archive was generated by hypermail 2b25 : Tue Nov 13 2001 - 01:56:19 CST