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

TagImpl.h

Go to the documentation of this file.
00001 #ifndef DEBTAGS_TAG_IMPL_H
00002 #define DEBTAGS_TAG_IMPL_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 <debtags/Vocabulary.h>
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 // vim:set ts=3 sw=3:
00109 #endif

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