#include <tag.h>
ept::debtags::Tag represents a Tag with all its informations. It is guaranteed to have fast value-copy semantics, so it can be passed around freely and efficiently without worrying about memory management issues.
The class is normally instantiated using a Vocabulary:
Tag tag = vocabulary.tagByName("made-of::lang:c++");
Tags can contain an "invalid" value, in which case using any of their methods will likely produce segfault. The "invalid" facets are useful as "none" return values:
Tag tag = vocabulary.tagByName("made-of"); if (!tag) throw SomeException("tag \"mytag\" has not been defined");
Public Types | |
typedef std::set< Tag > | Set |
Public Member Functions | |
Tag () | |
~Tag () | |
bool | operator== (const Tag &f) const |
bool | operator!= (const Tag &f) const |
bool | operator< (const Tag &f) const |
operator bool () const | |
bool | valid () const |
Facet | facet () const |
std::string | name () const |
Return the name of the tag, without the facet:: prefix. | |
std::string | name (const std::string &d) const |
std::string | fullname () const |
Return the name of the tag, with the facet:: prefix. | |
std::string | fullname (const std::string &d) const |
std::string | shortDescription () const |
Return the short description of the tag. | |
std::string | shortDescription (const std::string &d) const |
std::string | longDescription () const |
Return the long description of the tag. | |
std::string | longDescription (const std::string &d) const |
int | id () const |
Return the ID of this tag. | |
Protected Member Functions | |
Tag (const Vocabulary *tags, int id) | |
Protected Attributes | |
const Vocabulary * | m_tags |
int | m_id |
Friends | |
class | Vocabulary |
typedef std::set< Tag > ept::debtags::Tag::Set |
ept::debtags::Tag::Tag | ( | const Vocabulary * | tags, | |
int | id | |||
) | [inline, protected] |
ept::debtags::Tag::Tag | ( | ) | [inline] |
ept::debtags::Tag::~Tag | ( | ) | [inline] |
bool ept::debtags::Tag::operator== | ( | const Tag & | f | ) | const [inline] |
bool ept::debtags::Tag::operator!= | ( | const Tag & | f | ) | const [inline] |
bool ept::debtags::Tag::operator< | ( | const Tag & | f | ) | const [inline] |
ept::debtags::Tag::operator bool | ( | ) | const [inline] |
bool ept::debtags::Tag::valid | ( | ) | const [inline] |
Facet ept::debtags::Tag::facet | ( | ) | const |
std::string ept::debtags::Tag::name | ( | ) | const |
Return the name of the tag, without the facet:: prefix.
std::string ept::debtags::Tag::name | ( | const std::string & | d | ) | const |
std::string ept::debtags::Tag::fullname | ( | ) | const |
Return the name of the tag, with the facet:: prefix.
std::string ept::debtags::Tag::fullname | ( | const std::string & | d | ) | const |
std::string ept::debtags::Tag::shortDescription | ( | ) | const |
Return the short description of the tag.
std::string ept::debtags::Tag::shortDescription | ( | const std::string & | d | ) | const |
std::string ept::debtags::Tag::longDescription | ( | ) | const |
Return the long description of the tag.
std::string ept::debtags::Tag::longDescription | ( | const std::string & | d | ) | const |
int ept::debtags::Tag::id | ( | ) | const [inline] |
Return the ID of this tag.
friend class Vocabulary [friend] |
const Vocabulary* ept::debtags::Tag::m_tags [protected] |
int ept::debtags::Tag::m_id [protected] |