![]() |
![]() |
00001 #ifndef CLASSLIB_SUB_STORAGE_H 00002 # define CLASSLIB_SUB_STORAGE_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/sysapi/system.h" 00007 # include "classlib/iobase/Storage.h" 00008 # include <string> 00009 # include <cstdio> 00010 00011 namespace lat { 00012 //<<<<<< PUBLIC DEFINES >>>>>> 00013 //<<<<<< PUBLIC CONSTANTS >>>>>> 00014 //<<<<<< PUBLIC TYPES >>>>>> 00015 //<<<<<< PUBLIC VARIABLES >>>>>> 00016 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00017 //<<<<<< CLASS DECLARATIONS >>>>>> 00018 00033 class SubStorage : public Storage 00034 { 00035 public: 00036 // FIXME: bool expandable? 00037 SubStorage (Storage *base, IOOffset from, IOOffset len); 00038 ~SubStorage (void); 00039 00040 using Storage::read; 00041 using Storage::write; 00042 00043 virtual IOSize read (void *into, IOSize n); 00044 virtual IOSize write (const void *from, IOSize n); 00045 00046 virtual IOOffset position (void) const; 00047 virtual IOOffset position (IOOffset offset, Relative whence = SET); 00048 virtual void rewind (void); 00049 00050 virtual void resize (IOOffset size); 00051 00052 virtual void flush (void); 00053 virtual void close (void); 00054 00055 protected: 00056 Storage *m_base; 00057 IOOffset m_bias; 00058 IOOffset m_length; 00059 IOOffset m_position; 00060 }; 00061 00062 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00063 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00064 00065 } // namespace lat 00066 #endif // CLASSLIB_SUB_STORAGE_H