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

Method parseTC

src/Task.cpp:721–738  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Note that all fields undergo encode/decode.

Source from the content-addressed store, hash-verified

719////////////////////////////////////////////////////////////////////////////////
720// Note that all fields undergo encode/decode.
721void Task::parseTC(rust::Box<tc::TaskData> task) {
722 auto items = task->items();
723 data.clear();
724 for (auto& item : items) {
725 data[static_cast<std::string>(item.prop)] = static_cast<std::string>(item.value);
726 }
727
728 // count annotations
729 annotation_count = 0;
730 for (auto i : data) {
731 if (isAnnotationAttr(i.first)) {
732 ++annotation_count;
733 }
734 }
735
736 data["uuid"] = static_cast<std::string>(task->get_uuid().to_string());
737 id = Context::getContext().tdb2.id(data["uuid"]);
738}
739
740////////////////////////////////////////////////////////////////////////////////
741// No legacy formats are currently supported as of 2.4.0.

Callers

nothing calls this directly

Calls 5

itemsMethod · 0.80
clearMethod · 0.80
to_stringMethod · 0.80
idMethod · 0.80
get_uuidMethod · 0.45

Tested by

no test coverage detected