X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/89d88ac3ef3f82fdfeac6d8d231deddeeb0f02e9..fa74b4ece008f6600d530e28a609f31312c8c864:/apt-pkg/pkgsystem.h diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index 211fd0d56..5b31457e0 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -1,13 +1,12 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgsystem.h,v 1.6 2002/11/11 06:55:50 doogie Exp $ /* ###################################################################### System - Abstraction for running on different systems. Instances of this class can be thought of as factories or meta-classes for a variety of more specialized classes. Together this class and - it's speciallized offspring completely define the environment and how + it's specialized offspring completely define the environment and how to access resources for a specific system. There are several sub areas that are all orthogonal - each system has a unique combination of these sub areas: @@ -23,7 +22,7 @@ - Selection of local 'status' indexes that make up the pkgCache. It is important to note that the handling of index files is not a - function of the system. Index files are handled through a seperate + function of the system. Index files are handled through a separate abstraction - the only requirement is that the index files have the same idea of versioning as the target system. @@ -38,18 +37,22 @@ #define PKGLIB_PKGSYSTEM_H #include +#include #include +#ifndef APT_8_CLEANER_HEADERS +#include +#endif + class pkgDepCache; class pkgPackageManager; class pkgVersioningSystem; class Configuration; class pkgIndexFile; -class PkgFileIterator; class pkgSystem -{ +{ public: // Global list of supported systems @@ -57,8 +60,8 @@ class pkgSystem static unsigned long GlobalListLen; static pkgSystem *GetSystem(const char *Label); - const char *Label; - pkgVersioningSystem *VS; + const char * const Label; + pkgVersioningSystem * const VS; /* Prevent other programs from touching shared data not covered by other locks (cache or state locks) */ @@ -78,16 +81,21 @@ class pkgSystem virtual bool ArchiveSupported(const char *Type) = 0; // Return a list of system index files.. - virtual bool AddStatusFiles(std::vector &List) = 0; + virtual bool AddStatusFiles(std::vector &List) = 0; + virtual bool FindIndex(pkgCache::PkgFileIterator File, pkgIndexFile *&Found) const = 0; - + /* Evauluate how 'right' we are for this system based on the filesystem etc.. */ - virtual signed Score(Configuration const &/*Cnf*/) {return 0;}; - - pkgSystem(); - virtual ~pkgSystem() {}; + virtual signed Score(Configuration const &/*Cnf*/) { + return 0; + }; + + pkgSystem(char const * const Label, pkgVersioningSystem * const VS); + virtual ~pkgSystem(); + private: + void * const d; }; // The environment we are operating in.