apt: apt-pkg/edsp/edspsystem.h Source File

apt 3.3.3 commandline package manager

edspsystem.h
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 System - Debian version of the System Class
6
7 ##################################################################### */
8 /*}}}*/
9#ifndef PKGLIB_EDSPSYSTEM_H
10#define PKGLIB_EDSPSYSTEM_H
11
12#include <apt-pkg/pkgcache.h>
13#include <apt-pkg/pkgsystem.h>
14#include <apt-pkg/error.h>
15
16#include <memory>
17#include <vector>
18
19#include <apt-pkg/macros.h>
20
21class Configuration;
22class pkgDepCache;
23class pkgIndexFile;
24class pkgPackageManager;
25
26 class APT_HIDDEN edspLikeSystem : public pkgSystem
27{
28protected:
29 std::unique_ptr<pkgIndexFile> StatusFile;
30
31public:
32 bool Lock(OpProgress *Progress) override APT_PURE;
33 bool UnLock(bool NoErrors = false) override APT_PURE;
34 pkgPackageManager *CreatePM(pkgDepCache *Cache) const override APT_PURE;
35 bool Initialize(Configuration &Cnf) override;
36 bool ArchiveSupported(const char *Type) override APT_PURE;
37 signed Score(Configuration const &Cnf) override;
38 bool FindIndex(pkgCache::PkgFileIterator File,
39 pkgIndexFile *&Found) const override;
40
41 [[nodiscard]] bool MultiArchSupported() const override { return true; }
42 [[nodiscard]] std::vector<std::string> ArchitecturesSupported() const override { return {}; };
43
44 bool LockInner(OpProgress * const /*Progress*/, int /*timeOutSec*/) override { return _error->Error("LockInner is not implemented"); };
45 bool UnLockInner(bool /*NoErrors*/) override { return _error->Error("UnLockInner is not implemented"); };
46 bool IsLocked() override { return true; };
47
48 explicit edspLikeSystem(char const * const Label);
49 ~edspLikeSystem() override;
50};
51
52 class APT_HIDDEN edspSystem : public edspLikeSystem
53{
54 std::string tempDir;
55 std::string tempStatesFile;
56 std::string tempPrefsFile;
57
58public:
59 bool Initialize(Configuration &Cnf) override;
60 bool AddStatusFiles(std::vector<pkgIndexFile *> &List) override;
61
62 edspSystem();
63 ~edspSystem() override;
64};
65
66 class APT_HIDDEN eippSystem : public edspLikeSystem
67{
68 public:
69 bool AddStatusFiles(std::vector<pkgIndexFile *> &List) override;
70
71 eippSystem();
72 ~eippSystem() override;
73};
74
75#endif
Configuration
Definition configuration.h:41
OpProgress
Definition progress.h:30
edspLikeSystem
Definition edspsystem.h:27
edspLikeSystem::IsLocked
bool IsLocked() override
checks if the system is currently locked
Definition edspsystem.h:46
edspLikeSystem::ArchitecturesSupported
std::vector< std::string > ArchitecturesSupported() const override
Definition edspsystem.h:42
edspLikeSystem::MultiArchSupported
bool MultiArchSupported() const override
Definition edspsystem.h:41
pkgCache::PkgFileIterator
Definition cacheiterators.h:496
pkgDepCache
Definition depcache.h:63
pkgIndexFile
Definition indexfile.h:103
pkgPackageManager
Definition packagemanager.h:49
pkgcache.h
pkgCache - Structure definitions for the cache file