00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_QA_HH
00021 #define PALUDIS_GUARD_PALUDIS_QA_HH 1
00022
00023 #include <paludis/qa-fwd.hh>
00024 #include <paludis/package_id.hh>
00025 #include <paludis/metadata_key-fwd.hh>
00026 #include <paludis/util/fs_entry.hh>
00027 #include <paludis/util/sequence-fwd.hh>
00028 #include <paludis/util/set-fwd.hh>
00029 #include <paludis/util/named_value.hh>
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace paludis
00042 {
00043 namespace n
00044 {
00045 struct associated_ids;
00046 struct associated_keys;
00047 struct entry;
00048 struct level;
00049 struct message;
00050 struct name;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 struct PALUDIS_VISIBLE QAMessage
00062 {
00063 typedef Sequence<std::pair<std::tr1::shared_ptr<const PackageID>, std::tr1::shared_ptr<const MetadataKey> > > KeysSequence;
00064
00065 NamedValue<n::associated_ids, std::tr1::shared_ptr<PackageIDSet> > associated_ids;
00066 NamedValue<n::associated_keys, std::tr1::shared_ptr<KeysSequence> > associated_keys;
00067 NamedValue<n::entry, FSEntry> entry;
00068 NamedValue<n::level, QAMessageLevel> level;
00069 NamedValue<n::message, std::string> message;
00070 NamedValue<n::name, std::string> name;
00071
00072 static std::tr1::shared_ptr<PackageIDSet> default_associated_ids();
00073 static std::tr1::shared_ptr<KeysSequence> default_associated_keys();
00074 QAMessage & with_associated_id(const std::tr1::shared_ptr<const PackageID> &);
00075 QAMessage & with_associated_key(const std::tr1::shared_ptr<const PackageID> &, const std::tr1::shared_ptr<const MetadataKey> &);
00076
00077 QAMessage(const FSEntry &, const QAMessageLevel &, const std::string & name, const std::string & message);
00078 };
00079
00080
00081
00082
00083
00084
00085
00086 class PALUDIS_VISIBLE QAReporter
00087 {
00088 public:
00089 virtual ~QAReporter() = 0;
00090
00091
00092
00093
00094 virtual void message(const QAMessage &) = 0;
00095
00096
00097
00098
00099 virtual void status(const std::string &) = 0;
00100 };
00101 }
00102
00103 #endif