4 #include "zipios++/zipios-config.h" 8 #include "zipios++/meta-iostreams.h" 26 REDUCED3, REDUCED4, IMPLODED, RESERVED,
74 virtual uint32
getCrc()
const = 0 ;
80 virtual vector< unsigned char >
getExtra()
const = 0 ;
91 virtual string getName()
const = 0 ;
99 virtual uint32
getSize()
const = 0 ;
103 virtual int getTime()
const = 0 ;
109 virtual bool isValid()
const = 0 ;
121 virtual void setComment(
const string &comment ) = 0 ;
129 virtual void setCrc( uint32 crc ) = 0 ;
133 virtual void setExtra(
const vector< unsigned char > &extra ) = 0 ;
141 virtual void setName(
const string &name ) = 0 ;
145 virtual void setSize( uint32 size ) = 0 ;
149 virtual void setTime(
int time ) = 0 ;
154 virtual string toString()
const = 0 ;
171 void ref()
const { _refcount.ref() ; }
172 unsigned int unref()
const {
return _refcount.unref() ; }
183 explicit MatchName(
const string &name ) : _name( name ) {}
184 bool operator() (
const ConstEntryPointer &entry ) {
185 return entry->getName() == _name ;
197 explicit MatchFileName(
const string &name ) : _name( name ) {}
198 bool operator() (
const ConstEntryPointer &entry ) {
199 return entry->getFileName() == _name ;
205 ostream &operator<< ( ostream &os,
const FileEntry &entry ) ;
207 inline ostream &operator<< ( ostream &os,
const ConstEntryPointer &entry ) {
virtual FileEntry * clone() const =0
Create a heap allocated clone of the object this method is called for.
virtual uint32 getSize() const =0
Returns the (uncompressed) size of the entry data.
virtual void setCompressedSize(uint32 size)=0
Set the compressed size field of the entry.
virtual string toString() const =0
Returns a human-readable string representation of the entry.
Header file that defines some simple data types.
SimpleSmartPointer is a simple reference counting smart pointer template.
vector< EntryPointer > ConstEntries
ConstEntries is a vector of ConstEntryPointer's.
virtual void setCrc(uint32 crc)=0
Sets the crc field.
Header file that defines SimpleSmartPointer and ReferenceCount.
virtual StorageMethod getMethod() const =0
Returns the method used to store the entry in the FileCollection.
Function object to be used with the STL find_if algorithm to find a FileEntry in a container...
virtual void setTime(int time)=0
Sets the time field for the entry.
vector< EntryPointer > Entries
Entries is a vector of EntryPointer's.
virtual int getTime() const =0
Returns the date and time of FIXME: what?
virtual void setExtra(const vector< unsigned char > &extra)=0
Sets the extra field.
virtual void setName(const string &name)=0
Sets the name field for the entry.
virtual string getName() const =0
Returns the full filename of the entry, including a path if the entry is stored in a subfolder...
virtual ~FileEntry()
FileEntry destructor.
virtual void setComment(const string &comment)=0
Sets the comment field for the FileEntry.
ReferenceCount is useful to ensure proper handling of the reference count for (objects of) classes ha...
Function object to be used with the STL find_if algorithm to find a FileEntry in a container...
virtual string getFileName() const =0
Returns the filename of the entry.
virtual string getComment() const =0
Returns the comment of the entry, if it has one.
virtual void setSize(uint32 size)=0
Sets the size field for the entry.
A FileEntry represents an entry in a FileCollection.
virtual void setMethod(StorageMethod method)=0
Sets the storage method field for the entry.
StorageMethod
The types used with FileEntry::setMethod and FileEntry::getMethod.
virtual uint32 getCrc() const =0
Returns the Crc for the entry, if it has one.
virtual bool isDirectory() const =0
Returns true if the entry is a directory.
virtual vector< unsigned char > getExtra() const =0
Returns a vector of bytes of extra data that may be stored with the entry.
virtual uint32 getCompressedSize() const =0
Returns the compressed size of the entry.
virtual bool isValid() const =0
Any method or operator that initializes a FileEntry may set a flag, that specifies whether the read e...