filters
pole.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef POLE_H
00021 #define POLE_H
00022
00023 #include <string>
00024 #include <list>
00025
00026 namespace POLE
00027 {
00028
00029 class StorageIO;
00030 class Stream;
00031
00032 class Storage
00033 {
00034
00035 public:
00036
00037 enum { Ok, OpenFailed, NotOLE, BadOLE, UnknownError,
00038 StupidWorkaroundForBrokenCompiler=255 };
00039
00040 enum { ReadOnly, WriteOnly, ReadWrite };
00041
00042 Storage();
00043
00044 ~Storage();
00045
00051 bool open( const char* filename, int m = ReadOnly );
00052
00056 void flush();
00057
00064 void close();
00065
00066 std::list<std::string> listDirectory();
00067
00068 bool enterDirectory( const std::string& directory );
00069
00070 void leaveDirectory();
00071
00072 std::string path();
00073
00081 Stream* stream( const std::string& name );
00082
00083 int result;
00084
00085 protected:
00086
00087 StorageIO* io;
00088
00089 private:
00090
00091
00092 Storage( const Storage& );
00093 Storage& operator=( const Storage& );
00094
00095 };
00096
00097 class StreamIO;
00098
00099 class Stream
00100 {
00101 public:
00102
00103 Stream( StreamIO* io );
00104
00105 ~Stream();
00106
00107 unsigned long size();
00108
00109 unsigned long tell();
00110
00111 void seek( unsigned long pos );
00112
00113 int getch();
00114
00115 unsigned long read( unsigned char* data, unsigned long maxlen );
00116
00117 private:
00118
00119 StreamIO* io;
00120
00121
00122 Stream( const Stream& );
00123 Stream& operator=( const Stream& );
00124 };
00125
00126
00127 }
00128
00129 #endif // POLE_H
|