00001 #ifndef VOCABULARY_H
00002 #define VOCABULARY_H
00003
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <tagcoll/Exception.h>
00027 #include <tagcoll/TDBFile.h>
00028
00029
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
00100 #endif