00001 #ifndef VOCABULARY_H 00002 #define VOCABULARY_H 00003 00004 /* 00005 * Tag vocabulary access 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 #include <tagcoll/TagSet.h> 00025 #include <tagcoll/TagConsumer.h> 00026 #include <tagcoll/ParserBase.h> 00027 #include <tagcoll/DerivedTags.h> 00028 00029 #include <string> 00030 #include <list> 00031 #include <map> 00032 00033 namespace Tagcoll 00034 { 00035 class Facet; 00036 class FacetConsumer; 00037 class FacetFilter; 00038 class TagConsumer; 00039 class TagFilter; 00040 }; 00041 00042 namespace Debtags 00043 { 00044 using namespace Tagcoll; 00045 00046 class Vocabulary : public FacetSet 00047 { 00048 protected: 00049 DerivedTagList equations; 00050 00051 public: 00053 const DerivedTagList& getEquations() const throw () { return equations; } 00054 00056 bool hasFacet(const std::string& facet) const throw () { return has(facet); } 00057 00059 Facet findFacet(const std::string& facet) const throw () { return find(facet); } 00060 00062 const FacetSet& getFacets() const throw () { return *this; } 00063 00065 FacetSet getFacets(const FacetMatcher& filter) const throw () { return getFiltered(filter); } 00066 00068 void read(ParserInput& input) throw (ParserException); 00069 00071 void read() throw (FileException, ParserException); 00072 00074 void readVocabularies() throw (SystemException, FileException, ParserException); 00075 00077 void write() throw (FileException); 00078 00079 /* 00080 void outputImplications(TagcollConsumer<std::string>& consumer) const throw (); 00081 void outputDerivedTags(DerivedTagList& dtlist) const throw (); 00082 */ 00083 }; 00084 00085 }; 00086 00087 // vim:set ts=4 sw=4: 00088 #endif