MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / nodeToBookmark

Method nodeToBookmark

src/BookmarkMgr.cpp:615–638  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615BookmarkEntryPtr BookmarkMgr::nodeToBookmark(DataNode *node) {
616 if (!node->hasAnother("frequency") || !node->hasAnother("type") || !node->hasAnother("bandwidth")) {
617 return nullptr;
618 }
619
620 BookmarkEntryPtr be(new BookmarkEntry());
621
622 node->getNext("frequency")->element()->get(be->frequency);
623 node->getNext("type")->element()->get(be->type);
624 node->getNext("bandwidth")->element()->get(be->bandwidth);
625
626 if (node->hasAnother("user_label")) {
627 be->label = BookmarkMgr::getSafeWstringValue( node, "user_label");
628 }
629
630 node->rewindAll();
631
632 //fine to do so here, so long nobody overrides be->node, DataNode will be
633 //deleted at last BookmarkEntryPtr be ref.
634 //copy data from *node.
635 be->node = new DataNode("node",*node);
636
637 return be;
638}
639
640
641std::wstring BookmarkMgr::getBookmarkEntryDisplayName(const BookmarkEntryPtr& bmEnt) {

Callers

nothing calls this directly

Calls 5

hasAnotherMethod · 0.80
elementMethod · 0.80
getNextMethod · 0.80
rewindAllMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected