00001 #ifndef DEBTAGS_TAG_IMPL_H
00002 #define DEBTAGS_TAG_IMPL_H
00003
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <tagcoll/OpSet.h>
00028 #include <apt-pkg/tagfile.h>
00029 #include <debtags/fdecls.h>
00030
00031 namespace Debtags {
00032
00033 class Vocabulary;
00034
00035 class FacetImpl
00036 {
00037 protected:
00038 int _ref;
00039
00040 const Vocabulary& voc;
00041 pkgTagSection data;
00042
00043 public:
00044 FacetImpl(const Vocabulary& voc, const char* buf, unsigned int size) throw ();
00045
00047 void ref() throw () { ++_ref; }
00048
00051 bool unref() throw () { return --_ref == 0; }
00052
00053 bool hasTag(const std::string& name) const throw ();
00054
00055 std::string name() const throw ();
00056 std::string sdesc() const throw ();
00057 std::string ldesc() const throw ();
00058 std::string fulldata() const throw ();
00059
00063 std::string field(const std::string& name) const throw();
00064
00065 Tagcoll::OpSet<Tag> tags() const throw ();
00066
00067 friend class Facet;
00068 friend class Tag;
00069 friend class Vocabulary;
00070 };
00071
00072 class TagImpl
00073 {
00074 protected:
00075 int _ref;
00076
00077 FacetImpl* _facet;
00078 pkgTagSection data;
00079
00080 public:
00081 TagImpl(FacetImpl* facet, const char* buf, unsigned int size) throw ();
00082 ~TagImpl() throw ();
00083
00085 void ref() throw () { ++_ref; }
00086
00089 bool unref() throw () { return --_ref == 0; }
00090
00091 std::string name() const throw ();
00092 std::string fullname() const throw ();
00093 std::string sdesc() const throw ();
00094 std::string ldesc() const throw ();
00095 std::string fulldata() const throw ();
00096
00100 std::string field(const std::string& name) const throw();
00101
00102 friend class Tag;
00103 friend class Vocabulary;
00104 };
00105
00106 };
00107
00108
00109 #endif