diff --git a/src/CLI2.cpp b/src/CLI2.cpp index 55df8e7c2..10022f5c9 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -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 { diff --git a/src/CLI2.h b/src/CLI2.h index 168caa683..3678a1771 100644 --- a/src/CLI2.h +++ b/src/CLI2.h @@ -47,6 +47,7 @@ public: void attribute (const std::string&, const std::string&); void attribute (const std::string&, const int); const std::string attribute (const std::string&) const; + const std::string getToken () const; const std::string dump () const; public: