File: edspsystem.h

package info (click to toggle)
apt 3.1.13
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 22,764 kB
  • sloc: cpp: 71,085; sh: 31,750; xml: 5,553; perl: 217; python: 197; ansic: 191; makefile: 41
file content (75 lines) | stat: -rw-r--r-- 2,200 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// -*- mode: cpp; mode: fold -*-
// Description								/*{{{*/
/* ######################################################################

   System - Debian version of the  System Class

   ##################################################################### */
									/*}}}*/
#ifndef PKGLIB_EDSPSYSTEM_H
#define PKGLIB_EDSPSYSTEM_H

#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgsystem.h>
#include <apt-pkg/error.h>

#include <memory>
#include <vector>

#include <apt-pkg/macros.h>

class Configuration;
class pkgDepCache;
class pkgIndexFile;
class pkgPackageManager;

class APT_HIDDEN edspLikeSystem : public pkgSystem
{
protected:
   std::unique_ptr<pkgIndexFile> StatusFile;

public:
   bool Lock(OpProgress *Progress) override APT_PURE;
   bool UnLock(bool NoErrors = false) override APT_PURE;
   pkgPackageManager *CreatePM(pkgDepCache *Cache) const override APT_PURE;
   bool Initialize(Configuration &Cnf) override;
   bool ArchiveSupported(const char *Type) override APT_PURE;
   signed Score(Configuration const &Cnf) override;
   bool FindIndex(pkgCache::PkgFileIterator File,
		  pkgIndexFile *&Found) const override;

   [[nodiscard]] bool MultiArchSupported() const override { return true; }
   [[nodiscard]] std::vector<std::string> ArchitecturesSupported() const override { return {}; };

   bool LockInner(OpProgress * const /*Progress*/, int /*timeOutSec*/) override { return _error->Error("LockInner is not implemented"); };
   bool UnLockInner(bool /*NoErrors*/) override { return _error->Error("UnLockInner is not implemented"); };
   bool IsLocked() override { return true; };

   explicit edspLikeSystem(char const * const Label);
   ~edspLikeSystem() override;
};

class APT_HIDDEN edspSystem : public edspLikeSystem
{
   std::string tempDir;
   std::string tempStatesFile;
   std::string tempPrefsFile;

public:
   bool Initialize(Configuration &Cnf) override;
   bool AddStatusFiles(std::vector<pkgIndexFile *> &List) override;

   edspSystem();
   ~edspSystem() override;
};

class APT_HIDDEN eippSystem : public edspLikeSystem
{
   public:
   bool AddStatusFiles(std::vector<pkgIndexFile *> &List) override;

   eippSystem();
   ~eippSystem() override;
};

#endif