Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TagDB.h

Go to the documentation of this file.
00001 #ifndef DEBTAGS_TAGDB_H
00002 #define DEBTAGS_TAGDB_H
00003 
00004 /*
00005  * System tag database
00006  *
00007  * Copyright (C) 2003  Enrico Zini <enrico@debian.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // vim:set ts=4 sw=4:
00158 #endif

Generated on Wed Nov 17 23:22:57 2004 for libdebtags by  doxygen 1.3.9.1