#include <vocabularymerger.h>
Public Member Functions | |
VocabularyMerger () | |
bool | empty () const |
Check if there is any data in the merged vocabulary. | |
void | read (tagcoll::input::Input &input) |
Parse and import the vocabulary from `input', merging the data with the previously imported ones. | |
void | write (const std::string &fname) |
Write the vocabulary data to the given file. | |
void | write (FILE *out) |
Write the vocabulary data to the given output stream. | |
const tagcoll::diskindex::MMapIndexer & | facetIndexer () const |
Get the facet indexer. | |
const tagcoll::diskindex::MMapIndexer & | tagIndexer () const |
Get the tag indexer. | |
bool | hasFacet (const std::string &name) const |
Check if the vocabulary contains the facet `name'. | |
bool | hasTag (const std::string &fullname) const |
Check if the vocabulary contains the tag `fullname'. | |
int | tagID (const std::string &fullname) const |
Return the ID for the given tag (or -1 if not found). | |
std::set< std::string > | tagNames () const |
Return a set with all tag names. | |
Protected Member Functions | |
FacetData & | obtainFacet (const std::string &name) |
TagData & | obtainTag (const std::string &fullname) |
Protected Attributes | |
std::map< std::string, FacetData > | facets |
int | tagCount |
FacetIndexer | findexer |
TagIndexer | tindexer |
Classes | |
class | FacetData |
class | FacetIndexer |
class | TagData |
class | TagIndexer |
ept::debtags::VocabularyMerger::VocabularyMerger | ( | ) | [inline] |
VocabularyMerger::FacetData & ept::debtags::VocabularyMerger::obtainFacet | ( | const std::string & | name | ) | [protected] |
VocabularyMerger::TagData & ept::debtags::VocabularyMerger::obtainTag | ( | const std::string & | fullname | ) | [protected] |
References obtainFacet(), and ept::debtags::VocabularyMerger::FacetData::obtainTag().
Referenced by read().
bool ept::debtags::VocabularyMerger::empty | ( | ) | const [inline] |
Check if there is any data in the merged vocabulary.
References facets.
Referenced by ept::debtags::VocabularyIndexer::rebuild().
void ept::debtags::VocabularyMerger::read | ( | tagcoll::input::Input & | input | ) |
Parse and import the vocabulary from `input', merging the data with the previously imported ones.
References ept::debtags::VocabularyMerger::FacetData::name, ept::debtags::DebDBParser::nextRecord(), obtainFacet(), and obtainTag().
Referenced by TestVocabularyMerger::_1(), TestVocabulary::_18(), TestVocabularyMerger::_2(), TestVocabularyMerger::_3(), and ept::debtags::SourceDir::readVocabularies().
void ept::debtags::VocabularyMerger::write | ( | const std::string & | fname | ) |
Write the vocabulary data to the given file.
Referenced by TestVocabularyMerger::_1(), TestVocabularyMerger::_2(), TestVocabularyMerger::_3(), and ept::debtags::VocabularyIndexer::rebuild().
void ept::debtags::VocabularyMerger::write | ( | FILE * | out | ) |
const tagcoll::diskindex::MMapIndexer& ept::debtags::VocabularyMerger::facetIndexer | ( | ) | const [inline] |
Get the facet indexer.
Note: the indexers will only be functional after one of the write methods have been invoked
References findexer.
Referenced by TestVocabularyMerger::_1(), TestVocabularyMerger::_2(), TestVocabularyMerger::_3(), and ept::debtags::VocabularyIndexer::rebuild().
const tagcoll::diskindex::MMapIndexer& ept::debtags::VocabularyMerger::tagIndexer | ( | ) | const [inline] |
Get the tag indexer.
Note: the indexers will only be functional after one of the write methods have been invoked
References tindexer.
Referenced by TestVocabularyMerger::_1(), TestVocabularyMerger::_2(), TestVocabularyMerger::_3(), and ept::debtags::VocabularyIndexer::rebuild().
bool ept::debtags::VocabularyMerger::hasFacet | ( | const std::string & | name | ) | const [inline] |
bool ept::debtags::VocabularyMerger::hasTag | ( | const std::string & | fullname | ) | const |
int ept::debtags::VocabularyMerger::tagID | ( | const std::string & | fullname | ) | const |
std::set< std::string > ept::debtags::VocabularyMerger::tagNames | ( | ) | const |
std::map<std::string, FacetData> ept::debtags::VocabularyMerger::facets [protected] |
Referenced by empty(), ept::debtags::VocabularyMerger::TagIndexer::encode(), ept::debtags::VocabularyMerger::FacetIndexer::encode(), ept::debtags::VocabularyMerger::TagIndexer::encodedSize(), ept::debtags::VocabularyMerger::FacetIndexer::encodedSize(), hasFacet(), hasTag(), obtainFacet(), tagID(), tagNames(), and write().
int ept::debtags::VocabularyMerger::tagCount [protected] |
FacetIndexer ept::debtags::VocabularyMerger::findexer [protected] |
Referenced by facetIndexer().
TagIndexer ept::debtags::VocabularyMerger::tindexer [protected] |
Referenced by tagIndexer().