00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef DCKEYWORDLIST_H
00016 #define DCKEYWORDLIST_H
00017
00018 #include "dcbase.h"
00019
00020 class DCKeyword;
00021 class HashGenerator;
00022
00023
00024
00025
00026
00027
00028 class EXPCL_DIRECT DCKeywordList {
00029 public:
00030 DCKeywordList();
00031 DCKeywordList(const DCKeywordList ©);
00032 void operator = (const DCKeywordList ©);
00033 ~DCKeywordList();
00034
00035 PUBLISHED:
00036 bool has_keyword(const string &name) const;
00037 bool has_keyword(const DCKeyword *keyword) const;
00038 int get_num_keywords() const;
00039 const DCKeyword *get_keyword(int n) const;
00040 const DCKeyword *get_keyword_by_name(const string &name) const;
00041
00042 bool compare_keywords(const DCKeywordList &other) const;
00043
00044 public:
00045 void copy_keywords(const DCKeywordList &other);
00046
00047 bool add_keyword(const DCKeyword *keyword);
00048 void clear_keywords();
00049
00050 void output_keywords(ostream &out) const;
00051 void generate_hash(HashGenerator &hashgen) const;
00052
00053 private:
00054 typedef pvector<const DCKeyword *> Keywords;
00055 Keywords _keywords;
00056
00057 typedef pmap<string, const DCKeyword *> KeywordsByName;
00058 KeywordsByName _keywords_by_name;
00059
00060 int _flags;
00061 };
00062
00063 #endif