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

Vocabulary.h

Go to the documentation of this file.
00001 #ifndef VOCABULARY_H
00002 #define VOCABULARY_H
00003 
00008 /*
00009  * Copyright (C) 2003,2004,2005  Enrico Zini <enrico@debian.org>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  */
00025 
00026 #include <tagcoll/Exception.h>
00027 #include <tagcoll/TDBFile.h>
00028 
00029 // tdb wants fcntl.h to be included before it (probably a bug in tdb.h)
00030 #include <fcntl.h>
00031 #include <tdb.h>
00032 
00033 #include <string>
00034 #include <debtags/fdecls.h>
00035 
00036 namespace Debtags
00037 {
00038 
00039 class Vocabulary
00040 {
00041 protected:
00042     std::string filename;
00043     int fd;
00044     Tagcoll::TDBFile db;
00045     char* vocdata;
00046     off_t vocdata_len;
00047     
00048 public:
00049     Vocabulary(const std::string& filename, const std::string& indexname)
00050         throw (Tagcoll::SystemException);
00051     ~Vocabulary() throw ();
00052 
00056     bool hasFacet(const std::string& name) const throw ();
00057 
00061     bool hasTag(const std::string& fullname) const throw ();
00062 
00066     Facet getFacet(const std::string& name) const throw ();
00067 
00071     Tag getTag(const std::string& fillname) const throw ();
00072 
00076     Tagcoll::OpSet<Facet> getFacets() const throw ();
00077 
00081     Tagcoll::OpSet<Tag> getTags() const throw ();
00082 
00086     Tagcoll::OpSet<Tag> getTags(const std::string& facetName) const throw ();
00087 
00088 #if 0
00090     const DerivedTagList& getEquations() const throw () { return equations; }
00091     
00093     FacetSet getFacets(const FacetMatcher& filter) const throw () { return getFiltered(filter); }
00094 #endif
00095 };
00096 
00097 };
00098 
00099 // vim:set ts=4 sw=4:
00100 #endif

Generated on Sat Sep 10 03:44:50 2005 for libdebtags by  doxygen 1.4.4