MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / parse

Method parse

src/Task.cpp:525–546  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Try a JSON parse.

Source from the content-addressed store, hash-verified

523////////////////////////////////////////////////////////////////////////////////
524// Try a JSON parse.
525void Task::parse(const std::string& input) {
526 parseJSON(input);
527
528 // for compatibility, include all tags in `tags` as `tag_..` attributes
529 if (data.find("tags") != data.end()) {
530 for (auto& tag : split(data["tags"], ',')) {
531 data[tag2Attr(tag)] = "x";
532 }
533 }
534 // ..and similarly, update `tags` to match the `tag_..` attributes
535 fixTagsAttribute();
536
537 // same for `depends` / `dep_..`
538 if (data.find("depends") != data.end()) {
539 for (auto& dep : split(data["depends"], ',')) {
540 data[dep2Attr(dep)] = "x";
541 }
542 }
543 fixDependsAttribute();
544
545 recalc_urgency = true;
546}
547
548////////////////////////////////////////////////////////////////////////////////
549// Note that all fields undergo encode/decode.

Callers 11

TEST_NAMEFunction · 0.80
validateMethod · 0.80
getNextRecurrenceFunction · 0.80
isDateMethod · 0.80
isDurationMethod · 0.80
castMethod · 0.80
initializeMethod · 0.80
getDOMFunction · 0.80
executeMethod · 0.80
parseTaskMethod · 0.80
executeMethod · 0.80

Calls 1

findMethod · 0.80

Tested by 1

TEST_NAMEFunction · 0.64