Helper Command
- Added _query helper command for script writers, which accepts a filter like any other report, but returns raw JSON.
This commit is contained in:
23
src/Task.cpp
23
src/Task.cpp
@@ -423,6 +423,29 @@ std::string Task::composeYAML () const
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
std::string Task::composeJSON () const
|
||||
{
|
||||
std::stringstream out;
|
||||
out << "{";
|
||||
|
||||
std::map <std::string, Att>::const_iterator i;
|
||||
for (i = this->begin (); i != this->end (); ++i)
|
||||
{
|
||||
if (i != this->begin ())
|
||||
out << ",";
|
||||
|
||||
out << "\""
|
||||
<< i->second.name ()
|
||||
<< "\":\""
|
||||
<< i->second.value ()
|
||||
<< "\"";
|
||||
}
|
||||
|
||||
out << "}";
|
||||
return out.str ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void Task::getAnnotations (std::vector <Att>& annotations) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user