-
files
i want to treat physical files (those on the disk - but maybe also "extended" files (keyboard streams, etc.)) and chunks of memory the same way. (thus i wanna write a class for some kinda virtual file system - it should allow physical files to be linked into it, but it should also permit io with files which are actually just a piece of memory)
despite the fact that there are already libs which do that, i am writing my own solution - and i wont to keep work as little as possible - thus i came to the result that the stream classes might just do what i want.
so question 1)
so id need fstreams for file access and strstream for in memory files.
both classes are derived from iostream?
question 2)
does iostream inherit from istream and ostream (multi inheritance)?
and what is the common base of these two (is there any).
hmm...
basically the question is just: which stream class provides the interface for all other streams?
is there something like a java doc for the stl? where you see immediately whate the bases of some class is?
-
so what i basically want to do:
Code:
class StreamWrapper : public stream_interface {
protected:
stream_interface *p_stream; // polymorphic usage
... my attributes
public:
StreamWrapper(fstream *_p_stream) : p_stream(_p_stream) {}
StreamWrapper(strstream *_p_stream) : p_stream(_p_stream) {}
// all implementations of functions of the stream interface call the methods of p_stream
... my funtions
};
is there some stream interface class?
-
FINNALLY found a doc which explains it:
for those who are interested:
http://www.cplusplus.com/ref/iostream/istream/
no more replys needed