#ifndef PKGLIB_PKGCACHE_H
#define PKGLIB_PKGCACHE_H
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/macros.h>
+
#include <string>
#include <time.h>
-#include <apt-pkg/mmap.h>
#ifndef APT_8_CLEANER_HEADERS
using std::string;
std::string CacheFile;
MMap ⤅
- unsigned long sHash(const std::string &S) const;
- unsigned long sHash(const char *S) const;
+ unsigned long sHash(const std::string &S) const APT_PURE;
+ unsigned long sHash(const char *S) const APT_PURE;
public:
char *StrP;
virtual bool ReMap(bool const &Errorchecks = true);
- inline bool Sync() {return Map.Sync();};
- inline MMap &GetMap() {return Map;};
- inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();};
+ inline bool Sync() {return Map.Sync();}
+ inline MMap &GetMap() {return Map;}
+ inline void *DataEnd() {return ((unsigned char *)Map.Data()) + Map.Size();}
// String hashing function (512 range)
- inline unsigned long Hash(const std::string &S) const {return sHash(S);};
- inline unsigned long Hash(const char *S) const {return sHash(S);};
+ inline unsigned long Hash(const std::string &S) const {return sHash(S);}
+ inline unsigned long Hash(const char *S) const {return sHash(S);}
// Useful transformation things
const char *Priority(unsigned char Priority);
PkgIterator FindPkg(const std::string &Name);
PkgIterator FindPkg(const std::string &Name, const std::string &Arch);
- Header &Head() {return *HeaderP;};
+ Header &Head() {return *HeaderP;}
inline GrpIterator GrpBegin();
inline GrpIterator GrpEnd();
inline PkgIterator PkgBegin();
inline PkgFileIterator FileBegin();
inline PkgFileIterator FileEnd();
- inline bool MultiArchCache() const { return MultiArchEnabled; };
- inline char const * const NativeArch() const;
+ inline bool MultiArchCache() const { return MultiArchEnabled; }
+ inline char const * NativeArch();
// Make me a function
pkgVersioningSystem *VS;
// Converters
- static const char *CompTypeDeb(unsigned char Comp);
- static const char *CompType(unsigned char Comp);
+ static const char *CompTypeDeb(unsigned char Comp) APT_CONST;
+ static const char *CompType(unsigned char Comp) APT_CONST;
static const char *DepType(unsigned char Dep);
pkgCache(MMap *Map,bool DoMap = true);
- virtual ~pkgCache() {};
+ virtual ~pkgCache() {}
private:
bool MultiArchEnabled;
/** \brief Size of the complete cache file */
unsigned long CacheFileSize;
- bool CheckSizes(Header &Against) const;
+ bool CheckSizes(Header &Against) const APT_PURE;
Header();
};
/*}}}*/
/*}}}*/
-inline char const * const pkgCache::NativeArch() const
- { return StrP + HeaderP->Architecture; };
+inline char const * pkgCache::NativeArch()
+ { return StrP + HeaderP->Architecture; }
#include <apt-pkg/cacheiterators.h>
-inline pkgCache::GrpIterator pkgCache::GrpBegin()
- {return GrpIterator(*this);};
-inline pkgCache::GrpIterator pkgCache::GrpEnd()
- {return GrpIterator(*this,GrpP);};
-inline pkgCache::PkgIterator pkgCache::PkgBegin()
- {return PkgIterator(*this);};
-inline pkgCache::PkgIterator pkgCache::PkgEnd()
- {return PkgIterator(*this,PkgP);};
+inline pkgCache::GrpIterator pkgCache::GrpBegin()
+ {return GrpIterator(*this);}
+inline pkgCache::GrpIterator pkgCache::GrpEnd()
+ {return GrpIterator(*this,GrpP);}
+inline pkgCache::PkgIterator pkgCache::PkgBegin()
+ {return PkgIterator(*this);}
+inline pkgCache::PkgIterator pkgCache::PkgEnd()
+ {return PkgIterator(*this,PkgP);}
inline pkgCache::PkgFileIterator pkgCache::FileBegin()
- {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);};
+ {return PkgFileIterator(*this,PkgFileP + HeaderP->FileList);}
inline pkgCache::PkgFileIterator pkgCache::FileEnd()
- {return PkgFileIterator(*this,PkgFileP);};
+ {return PkgFileIterator(*this,PkgFileP);}
// Oh I wish for Real Name Space Support
class pkgCache::Namespace /*{{{*/
-{
+{
public:
typedef pkgCache::GrpIterator GrpIterator;
typedef pkgCache::PkgIterator PkgIterator;
typedef pkgCache::DepIterator DepIterator;
typedef pkgCache::PrvIterator PrvIterator;
typedef pkgCache::PkgFileIterator PkgFileIterator;
- typedef pkgCache::VerFileIterator VerFileIterator;
+ typedef pkgCache::VerFileIterator VerFileIterator;
typedef pkgCache::Version Version;
typedef pkgCache::Description Description;
typedef pkgCache::Package Package;