#ifndef __INPUT_H__ #define __INPUT_H__ #include #include #include #include class Input : public Handle { public: Input(const String & = "") throw (GeneralException); Input(const Input &); virtual ~Input() {} virtual bool CanWrite() const; virtual bool CanRead() const; virtual bool CanSeek() const; virtual off_t seek(off_t, int = SEEK_SET) throw (GeneralException); virtual String GetName() const; virtual ssize_t GetSize() const; virtual time_t GetModif() const; protected: String n; off_t size; time_t date_modif; }; class Stdin_t : public Input { public: Stdin_t(); virtual ~Stdin_t() {} virtual bool CanSeek() const; virtual String GetName() const; }; extern Stdin_t Stdin; enum ArchiveType { ARCHIVE_BUILTIN = 0 } class Archive : public Base { public: Archive(const String &, ArchiveType = 0) throw (GeneralException); virtual ~Archive(); static bool inarchive(const String &); static Input & open(const String &) throw (GeneralException); private: bool inarchivein(const String &); Input & openin(const String &) throw (GeneralException); class FileTree : public Base { public: FileTree(const String & = "", size_t = 0, FileTree * = 0, int = 0); virtual ~FileTree(); int compute_ptrs(size_t = 0); String name; int type; size_t size; size_t ptr; private: void touched(); FileTree * next, * prev, * father, * child; } filetree; String name; Input archive; Archive * next, * prev; static Archive * header; }; #endif