Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUPT_SYSTEM_STATE_SEEN
00019 #define CUPT_SYSTEM_STATE_SEEN
00020
00022
00023 #include <cupt/common.hpp>
00024 #include <cupt/fwd.hpp>
00025
00026 namespace cupt {
00027
00028 namespace internal {
00029
00030 class CacheImpl;
00031 class StateData;
00032
00033 }
00034
00036 namespace system {
00037
00039 class CUPT_API State
00040 {
00041 internal::StateData* __data;
00042 State(const State&);
00043 public:
00045 struct InstalledRecord
00046 {
00048 struct Want
00049 {
00051 enum Type { Unknown, Install, Hold, Deinstall, Purge, Count };
00052 };
00054 struct Flag
00055 {
00057 enum Type { Ok, Reinstreq, Hold, HoldAndReinstreq, Count };
00058 };
00060 struct Status
00061 {
00063 enum Type { NotInstalled, Unpacked, HalfConfigured, HalfInstalled, ConfigFiles,
00064 PostInstFailed, RemovalFailed, Installed, TriggersPending, TriggersAwaited, Count };
00065 static const string strings[];
00066 };
00067 Want::Type want;
00068 Flag::Type flag;
00069 Status::Type status;
00070
00072 bool isBroken() const;
00073 };
00074
00076 CUPT_LOCAL State(shared_ptr< const Config >, internal::CacheImpl*);
00078 ~State();
00079
00081
00085 shared_ptr< const InstalledRecord > getInstalledInfo(const string& packageName) const;
00087
00090 vector< string > getInstalledPackageNames() const;
00092 CUPT_LOCAL vector< string > getReinstallRequiredPackageNames() const;
00094 };
00095
00096 }
00097 }
00098
00099 #endif
00100