Thread: files

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    244

    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?
    signature under construction

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    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?
    signature under construction

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    244
    FINNALLY found a doc which explains it:

    for those who are interested:
    http://www.cplusplus.com/ref/iostream/istream/


    no more replys needed
    signature under construction

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM