diff --git a/src/CLI.cpp b/src/CLI.cpp index 205258ec..153b14fc 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -80,6 +80,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 { diff --git a/src/CLI.h b/src/CLI.h index 53db05af..4c1d90b4 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -42,6 +42,7 @@ public: void unTag (const std::string&); void attribute (const std::string&, const std::string&); const std::string attribute (const std::string&) const; + const std::string getToken () const; const std::string dump () const; public: