mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CLI: A2::attribute accessor added
This commit is contained in:
parent
d799d553fc
commit
e695b0773b
2 changed files with 13 additions and 0 deletions
12
src/CLI.cpp
12
src/CLI.cpp
|
@ -67,6 +67,18 @@ void A2::attribute (const std::string& name, const std::string& value)
|
|||
_attributes[name] = value;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Accessor for attributes.
|
||||
const std::string A2::attribute (const std::string& name) const
|
||||
{
|
||||
// Prevent autovivification.
|
||||
auto i = _attributes.find (name);
|
||||
if (i != _attributes.end ())
|
||||
return i->second;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void CLI::entity (const std::string& category, const std::string& name)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue