CLI2: Added ::getToken method for obtaining the canonical form, if possible
This commit is contained in:
10
src/CLI2.cpp
10
src/CLI2.cpp
@@ -137,6 +137,16 @@ const std::string A2::attribute (const std::string& name) const
|
|||||||
return "";
|
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
|
const std::string A2::dump () const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
void attribute (const std::string&, const std::string&);
|
void attribute (const std::string&, const std::string&);
|
||||||
void attribute (const std::string&, const int);
|
void attribute (const std::string&, const int);
|
||||||
const std::string attribute (const std::string&) const;
|
const std::string attribute (const std::string&) const;
|
||||||
|
const std::string getToken () const;
|
||||||
const std::string dump () const;
|
const std::string dump () const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user