libept
0.5.25
|
Representation of a tag. More...
#include <tag.h>
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. More... | |
std::string | name (const std::string &d) const |
Return the short description of the tag. More... | |
std::string | fullname () const |
Return the name of the tag, with the facet:: prefix. More... | |
std::string | fullname (const std::string &d) const |
Return the short description of the tag. More... | |
std::string | shortDescription () const |
Return the short description of the tag. More... | |
std::string | shortDescription (const std::string &d) const |
Return the short description of the tag. More... | |
std::string | longDescription () const |
Return the long description of the tag. More... | |
std::string | longDescription (const std::string &d) const |
Return the long description of the tag. More... | |
int | id () const |
Return the ID of this tag. More... | |
Protected Member Functions | |
Tag (const Vocabulary *tags, int id) | |
Protected Attributes | |
const Vocabulary * | m_tags |
int | m_id |
Friends | |
class | Vocabulary |
Representation of a tag.
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:
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:
typedef std::set< Tag > ept::debtags::Tag::Set |
|
inlineprotected |
|
inline |
|
inline |
Facet ept::debtags::Tag::facet | ( | ) | const |
References ept::debtags::Vocabulary::facetByTag(), m_id, m_tags, and valid().
std::string ept::debtags::Tag::fullname | ( | ) | const |
Return the name of the tag, with the facet:: prefix.
std::out_of_range | if the tag is not valid |
References m_id, m_tags, ept::debtags::Vocabulary::tagName(), and valid().
Referenced by TestVocabulary::_13(), TestVocabulary::_15(), TestDebtags::_2(), TestVocabulary::_6(), and ept::debtags::PatchIntToString< OUT >::operator=().
std::string ept::debtags::Tag::fullname | ( | const std::string & | d | ) | const |
Return the short description of the tag.
Returns d if the tag is not valid.
References m_id, m_tags, ept::debtags::Vocabulary::tagName(), and valid().
|
inline |
Return the ID of this tag.
References m_id.
Referenced by TestDebtags::_2(), ept::debtags::Debtags::getCardinality(), ept::debtags::Debtags::getItemsHavingTag(), ept::debtags::Debtags::hasTag(), ept::debtags::StringToInt< OUT >::operator=(), and ept::debtags::PatchStringToInt< OUT >::operator=().
std::string ept::debtags::Tag::longDescription | ( | ) | const |
Return the long description of the tag.
std::out_of_range | if the tag is not valid |
References m_id, m_tags, ept::debtags::Vocabulary::tagData(), and valid().
Referenced by TestVocabulary::_15().
std::string ept::debtags::Tag::longDescription | ( | const std::string & | d | ) | const |
Return the long description of the tag.
Returns d if the tag is not valid.
References m_id, m_tags, ept::debtags::Vocabulary::tagData(), and valid().
std::string ept::debtags::Tag::name | ( | ) | const |
Return the name of the tag, without the facet:: prefix.
std::out_of_range | if the tag is not valid |
References m_id, m_tags, ept::debtags::Vocabulary::tagShortName(), and valid().
Referenced by TestVocabulary::_13(), TestVocabulary::_15(), and TestVocabulary::_6().
std::string ept::debtags::Tag::name | ( | const std::string & | d | ) | const |
Return the short description of the tag.
Returns d if the tag is not valid.
References m_id, m_tags, ept::debtags::Vocabulary::tagShortName(), and valid().
|
inline |
std::string ept::debtags::Tag::shortDescription | ( | ) | const |
Return the short description of the tag.
std::out_of_range | if the tag is not valid |
References m_id, m_tags, ept::debtags::Vocabulary::tagData(), and valid().
Referenced by TestVocabulary::_13(), and TestVocabulary::_15().
std::string ept::debtags::Tag::shortDescription | ( | const std::string & | d | ) | const |
Return the short description of the tag.
Returns d if the tag is not valid.
References m_id, m_tags, ept::debtags::Vocabulary::tagData(), and valid().
|
inline |
Referenced by facet(), fullname(), longDescription(), name(), ept::debtags::IntToPkg< OUT >::operator=(), ept::debtags::StringToInt< OUT >::operator=(), ept::debtags::StringToPkg< OUT >::operator=(), ept::debtags::PatchStringToInt< OUT >::operator=(), ept::debtags::PatchIntToString< OUT >::operator=(), and shortDescription().
|
friend |
|
protected |
Referenced by facet(), fullname(), id(), longDescription(), name(), operator!=(), operator<(), operator==(), and shortDescription().
|
protected |
Referenced by facet(), fullname(), longDescription(), name(), and shortDescription().