libzypp  15.3.0
SystemCheck.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_TARGET_SYSTEMCHECK_H
13 #define ZYPP_TARGET_SYSTEMCHECK_H
14 
15 #include <iosfwd>
16 
17 #include "zypp/base/NonCopyable.h"
18 #include "zypp/Capability.h"
19 
21 namespace zypp
22 {
23  //
25  // CLASS NAME : SystemCheck
26  //
30  {
31  friend std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );
32 
33  public:
34 
36  static const SystemCheck & instance();
37 
39  const Pathname & file();
40 
42  const Pathname & dir();
43 
47  bool setFile(const Pathname & file) const;
48 
53  bool setDir(const Pathname & dir) const;
54 
57  const CapabilitySet & requiredSystemCap() const;
58 
61  const CapabilitySet & conflictSystemCap() const;
62 
63  private:
65  SystemCheck();
66  bool loadFile(Pathname &file, bool reset_caps = true) const;
67  bool loadFiles() const;
68  };
70 
72  std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );
73 
75 } // namespace zypp
77 #endif // ZYPP_TARGET_SYSTEMCHECK_H
bool setDir(const Pathname &dir) const
Set configuration directory for files of system requirements.
Definition: SystemCheck.cc:64
String related utilities and Regular expression matching.
SystemCheck()
Ctor taking the file to read.
Definition: SystemCheck.cc:46
std::tr1::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
const Pathname & dir()
Return the directory path.
Definition: SystemCheck.cc:76
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Definition: Exception.cc:120
bool loadFile(Pathname &file, bool reset_caps=true) const
Definition: SystemCheck.cc:88
bool setFile(const Pathname &file) const
Set configuration file of system requirements Should be used for testcase only.
Definition: SystemCheck.cc:57
static const SystemCheck & instance()
Singleton.
Definition: SystemCheck.cc:39
friend std::ostream & operator<<(std::ostream &str, const SystemCheck &obj)
Definition: SystemCheck.cc:154
const CapabilitySet & conflictSystemCap() const
Returns a list of conflicting system capabilities.
Definition: SystemCheck.cc:84
Save and restore locale set from file.
Definition: SystemCheck.h:29
const CapabilitySet & requiredSystemCap() const
Returns a list of required system capabilities.
Definition: SystemCheck.cc:80
const Pathname & file()
Return the file path.
Definition: SystemCheck.cc:72
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
bool loadFiles() const
Definition: SystemCheck.cc:129