CLI2: Added ::getToken method for obtaining the canonical form, if possible

This commit is contained in:
Paul Beckingham 2015-06-22 00:35:35 -04:00
parent 9db73962da
commit 7432c0aead
2 changed files with 11 additions and 0 deletions

View file

@ -137,6 +137,16 @@ const std::string A2::attribute (const std::string& name) const
return "";
}
////////////////////////////////////////////////////////////////////////////////
const std::string A2::getToken () const
{
auto i = _attributes.find ("canonical");
if (i == _attributes.end ())
i = _attributes.find ("raw");
return i->second;
}
////////////////////////////////////////////////////////////////////////////////
const std::string A2::dump () const
{