00001 #ifndef DEBTAGS_TAGDB_H
00002 #define DEBTAGS_TAGDB_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #pragma interface
00025
00026 #include <tagcoll/Exception.h>
00027 #include <tagcoll/ParserBase.h>
00028 #include <tagcoll/TagcollConsumer.h>
00029 #include <tagcoll/InputMerger.h>
00030 #include <tagcoll/Tag.h>
00031 #include <debtags/Package.h>
00032
00033 namespace Tagcoll
00034 {
00035 class TagSet;
00036 };
00037
00038 namespace Debtags
00039 {
00040 using namespace Tagcoll;
00041
00042 class Package;
00043
00049 class TagDB : public InputMerger<Package, Tag>
00050 {
00051 public:
00057 TagDB(bool editable = false) throw (SystemException, ConsistencyCheckException);
00058 ~TagDB() throw ();
00059
00061 TagSet getTags() const throw ();
00062
00063
00069 void load(bool facet_only = true) throw (FileException, ParserException);
00070
00071
00074 void savePatch()
00075 throw (FileException, ParserException, SystemException);
00076
00079 void savePatch(const InputMerger<Package, Tag>& collection)
00080 throw (FileException, ParserException, SystemException);
00081
00084 void sendPatch()
00085 throw (FileException, ParserException, SystemException, ConsistencyCheckException);
00086
00089 void sendPatch(const InputMerger<Package, Tag>& collection)
00090 throw (FileException, ParserException, SystemException, ConsistencyCheckException);
00091
00092
00094 static const std::string& statedir() throw ();
00095
00097 static const std::string& path_tagdb() throw ();
00098
00101 static bool hasTagDatabase() throw ();
00102
00103
00107 static void outputFile(const std::string& name, TagcollConsumer<std::string, std::string>& cons, bool facet_only = true)
00108 throw (FileException, ParserException);
00109
00113 static void outputFile(const std::string& name, TagcollConsumer<std::string, Tag>& cons, bool facet_only = true)
00114 throw (FileException, ParserException);
00115
00119 static void outputFile(const std::string& name, TagcollConsumer<Package, Tag>& cons, bool facet_only = true)
00120 throw (FileException, ParserException);
00121
00122
00126 static void outputSystem(TagcollConsumer<std::string, std::string>& cons, bool facet_only = true)
00127 throw (FileException, ParserException);
00128
00132 static void outputSystem(TagcollConsumer<std::string, Tag>& cons, bool facet_only = true)
00133 throw (FileException, ParserException);
00134
00138 static void outputSystem(TagcollConsumer<Package, Tag>& cons, bool facet_only = true)
00139 throw (FileException, ParserException);
00140
00141
00143 static void outputPatched(TagcollConsumer<std::string, std::string>& cons, bool facet_only = true)
00144 throw (FileException, ParserException);
00145
00147 static void outputPatched(TagcollConsumer<std::string, Tag>& cons, bool facet_only = true)
00148 throw (FileException, ParserException);
00149
00151 static void outputPatched(TagcollConsumer<Package, Tag>& cons, bool facet_only = true)
00152 throw (FileException, ParserException);
00153 };
00154
00155 };
00156
00157
00158 #endif