basicentry.h
Go to the documentation of this file.
#ifndef BASICENTRY_H
#define BASICENTRY_H
#include "zipios++/zipios-config.h"
#include "zipios++/meta-iostreams.h"
#include <string>
#include "zipios++/fcollexceptions.h"
#include "zipios++/fileentry.h"
#include "zipios++/filepath.h"
#include "zipios++/zipios_defs.h"
namespace zipios {
class BasicEntry : public FileEntry {
public:
explicit BasicEntry( const string &filename, const string &comment,
const FilePath &basepath = FilePath() ) ;
virtual string getComment() const ;
virtual uint32 getCompressedSize() const ;
virtual uint32 getCrc() const ;
virtual vector< unsigned char > getExtra() const ;
virtual StorageMethod getMethod() const ;
virtual string getName() const ;
virtual string getFileName() const ;
virtual uint32 getSize() const ;
virtual int getTime() const ;
virtual bool isValid() const ;
// virtual int hashCode() const ;
virtual bool isDirectory() const ;
virtual void setComment( const string &comment ) ;
virtual void setCompressedSize( uint32 size ) ;
virtual void setCrc( uint32 crc ) ;
virtual void setExtra( const vector< unsigned char > &extra ) ;
virtual void setMethod( StorageMethod method ) ;
virtual void setName( const string &name ) ;
virtual void setSize( uint32 size ) ;
virtual void setTime( int time ) ;
virtual string toString() const ;
virtual FileEntry *clone() const ;
virtual ~BasicEntry() ;
protected:
string _filename ;
string _comment ;
int _size ;
bool _valid ;
FilePath _basepath ;
};
}
#endif
/*
Zipios++ - a small C++ library that provides easy access to .zip files.
Copyright (C) 2000 Thomas Søndergaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
zipios::BasicEntry::getComment
virtual string getComment() const
Returns the comment of the entry, if it has one.
Definition basicentry.cpp:42
zipios::BasicEntry::getMethod
virtual StorageMethod getMethod() const
Returns the method used to store the entry in the FileCollection.
Definition basicentry.cpp:58
zipios::BasicEntry::getSize
virtual uint32 getSize() const
Returns the (uncompressed) size of the entry data.
Definition basicentry.cpp:79
zipios::BasicEntry::toString
virtual string toString() const
Returns a human-readable string representation of the entry.
Definition basicentry.cpp:126
zipios::BasicEntry::setName
virtual void setName(const string &name)
Sets the name field for the entry.
Definition basicentry.cpp:114
zipios::BasicEntry::setCrc
virtual void setCrc(uint32 crc)
Sets the crc field.
Definition basicentry.cpp:105
zipios::BasicEntry::setMethod
virtual void setMethod(StorageMethod method)
Sets the storage method field for the entry.
Definition basicentry.cpp:111
zipios::BasicEntry::getName
virtual string getName() const
Returns the full filename of the entry, including a path if the entry is stored in a subfolder.
Definition basicentry.cpp:62
zipios::BasicEntry::getCrc
virtual uint32 getCrc() const
Returns the Crc for the entry, if it has one.
Definition basicentry.cpp:50
zipios::BasicEntry::isDirectory
virtual bool isDirectory() const
Returns true if the entry is a directory.
Definition basicentry.cpp:92
zipios::BasicEntry::clone
virtual FileEntry * clone() const
Create a heap allocated clone of the object this method is called for.
Definition basicentry.cpp:132
zipios::BasicEntry::isValid
virtual bool isValid() const
Any method or operator that initializes a FileEntry may set a flag, that specifies whether the read e...
Definition basicentry.cpp:87
zipios::BasicEntry::setTime
virtual void setTime(int time)
Sets the time field for the entry.
Definition basicentry.cpp:122
zipios::BasicEntry::BasicEntry
BasicEntry(const string &filename, const string &comment, const FilePath &basepath=FilePath())
Constructor.
Definition basicentry.cpp:24
zipios::BasicEntry::setSize
virtual void setSize(uint32 size)
Sets the size field for the entry.
Definition basicentry.cpp:118
zipios::BasicEntry::getFileName
virtual string getFileName() const
Returns the filename of the entry.
Definition basicentry.cpp:66
zipios::BasicEntry::getTime
virtual int getTime() const
Returns the date and time of FIXME: what?
Definition basicentry.cpp:83
zipios::BasicEntry::setCompressedSize
virtual void setCompressedSize(uint32 size)
Set the compressed size field of the entry.
Definition basicentry.cpp:102
zipios::BasicEntry::setExtra
virtual void setExtra(const vector< unsigned char > &extra)
Sets the extra field.
Definition basicentry.cpp:108
zipios::BasicEntry::getCompressedSize
virtual uint32 getCompressedSize() const
Returns the compressed size of the entry.
Definition basicentry.cpp:46
zipios::BasicEntry::getExtra
virtual vector< unsigned char > getExtra() const
Returns a vector of bytes of extra data that may be stored with the entry.
Definition basicentry.cpp:54
zipios::BasicEntry::setComment
virtual void setComment(const string &comment)
Sets the comment field for the FileEntry.
Definition basicentry.cpp:98
zipios::FileEntry
A FileEntry represents an entry in a FileCollection.
Definition fileentry.h:52
zipios::FilePath
FilePath represents a path to a file or directory name.
Definition filepath.h:18
fcollexceptions.h
Header file that defines a number of exceptions used by FileCollection and its subclasses.
fileentry.h
Header file that defines FileEntry.
zipios::StorageMethod
StorageMethod
The types used with FileEntry::setMethod and FileEntry::getMethod.
Definition fileentry.h:25
filepath.h
Header file that defines FilePath.
zipios_defs.h
Header file that defines some simple data types.