SystemCheck.h 2.58 KB
Newer Older
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
/*---------------------------------------------------------------------\
|                          ____ _   __ __ ___                          |
|                         |__  / \ / / . \ . \                         |
|                           / / \ V /|  _/  _/                         |
|                          / /__ | | | | | |                           |
|                         /_____||_| |_| |_|                           |
|                                                                      |
\---------------------------------------------------------------------*/
/** \file	zypp/target/SystemCheck.h
 *
*/
#ifndef ZYPP_TARGET_SYSTEMCHECK_H
#define ZYPP_TARGET_SYSTEMCHECK_H

#include <iosfwd>

#include "zypp/base/NonCopyable.h"
#include "zypp/Capability.h"

///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    //
    //	CLASS NAME : SystemCheck
    //
    /** Save and restore locale set from file.
     */
    class SystemCheck : private base::NonCopyable
    {
      friend std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );

      public:

	/** Singleton */
	static const SystemCheck & instance();

        /** Return the file path. */
        const Pathname & file();

41 42 43
        /** Return the directory path. */
        const Pathname & dir();

44 45 46 47 48
        /** Set configuration file of system requirements
	 *  Should be used for testcase only   
	 */
        bool setFile(const Pathname & file) const;

49 50 51 52 53 54
        /** Set configuration directory for files of system
	 *  requirements.
         *  Should be used for testcase only
	 */
        bool setDir(const Pathname & dir) const;

55 56 57 58 59 60 61 62 63 64 65
        /** Returns a list of required system capabilities.
        */
        const CapabilitySet & requiredSystemCap() const;

        /** Returns a list of conflicting system capabilities.
        */
        const CapabilitySet & conflictSystemCap() const;

      private:
        /** Ctor taking the file to read. */
        SystemCheck();
66 67
        bool loadFile(Pathname &file, bool reset_caps = true) const;
	bool loadFiles() const;
68 69 70 71 72 73 74 75 76 77
    };
    ///////////////////////////////////////////////////////////////////

    /** \relates SystemCheck Stream output */
    std::ostream & operator<<( std::ostream & str, const SystemCheck & obj );

  /////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
#endif // ZYPP_TARGET_SYSTEMCHECK_H