- Added alias collection methods.
This commit is contained in:
Paul Beckingham 2014-07-03 18:49:32 -04:00
parent 468da9dcde
commit 6145869f43
2 changed files with 8 additions and 0 deletions

View file

@ -187,6 +187,12 @@ Tree* Parser::parse ()
return _tree; return _tree;
} }
////////////////////////////////////////////////////////////////////////////////
void Parser::alias (const std::string& name, const std::string& value)
{
_aliases.insert (std::pair <std::string, std::string> (name, value));
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
void Parser::entity (const std::string& name, const std::string& value) void Parser::entity (const std::string& name, const std::string& value)
{ {

View file

@ -42,6 +42,7 @@ public:
void appendStdin (); void appendStdin ();
Tree* tree (); Tree* tree ();
Tree* parse (); Tree* parse ();
void alias (const std::string&, const std::string&);
void entity (const std::string&, const std::string&); void entity (const std::string&, const std::string&);
bool exactMatch (const std::string&, const std::string&) const; bool exactMatch (const std::string&, const std::string&) const;
bool canonicalize (std::string&, const std::string&, const std::string&) const; bool canonicalize (std::string&, const std::string&, const std::string&) const;
@ -85,6 +86,7 @@ private:
private: private:
Tree* _tree; Tree* _tree;
std::multimap <std::string, std::string> _entities; std::multimap <std::string, std::string> _entities;
std::map <std::string, std::string> _aliases;
}; };
#endif #endif