92a8659427e256a99cbe08df21f601bb0b5dbeca
[platform/upstream/libzypp.git] / zypp / solver / detail / SystemCheck.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/target/SystemCheck.h
10  *
11 */
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
20 ///////////////////////////////////////////////////////////////////
21 namespace zypp
22 { /////////////////////////////////////////////////////////////////
23     ///////////////////////////////////////////////////////////////////
24     //
25     //  CLASS NAME : SystemCheck
26     //
27     /** Save and restore locale set from file.
28      */
29     class SystemCheck : private base::NonCopyable
30     {
31       friend std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );
32
33       public:
34
35         /** Singleton */
36         static const SystemCheck & instance();
37
38         /** Return the file path. */
39         const Pathname & file();
40
41         /** Set configuration file of system requirements
42          *  Should be used for testcase only   
43          */
44         bool setFile(const Pathname & file) const;
45
46         /** Returns a list of required system capabilities.
47         */
48         const CapabilitySet & requiredSystemCap() const;
49
50         /** Returns a list of conflicting system capabilities.
51         */
52         const CapabilitySet & conflictSystemCap() const;
53
54       private:
55         /** Ctor taking the file to read. */
56         SystemCheck();
57         bool loadFile() const;
58
59     };
60     ///////////////////////////////////////////////////////////////////
61
62     /** \relates SystemCheck Stream output */
63     std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );
64
65   /////////////////////////////////////////////////////////////////
66 } // namespace zypp
67 ///////////////////////////////////////////////////////////////////
68 #endif // ZYPP_TARGET_SYSTEMCHECK_H