diff --git a/main.cpp b/main.cpp index 6202475..b532954 100644 --- a/main.cpp +++ b/main.cpp @@ -41,6 +41,7 @@ struct NotebookInfo { std::uint64_t version = 0; std::uintmax_t total_size = 0; bool deleted = false; + bool isolated = true; }; struct Node { @@ -106,6 +107,7 @@ NotebookMapType build_notebook_infos ( curr_info.type = json_doc["type"]; curr_info.version = json_doc["version"]; curr_info.visible_name = json_doc["visibleName"]; + curr_info.isolated = false; } else if (fs::is_directory(entry)) { for (const auto& subentry : fs::recursive_directory_iterator(entry)) { @@ -167,9 +169,12 @@ std::vector to_tree (const NotebookMapType& nbs) { return roots; } + void print_tree (const Node& tree, std::string_view desc={}, std::string indent={}) { std::cout << indent << desc << " (\"" << tree.name << "\")"; - if (tree.info and tree.info->deleted) + if (tree.info && tree.info->isolated) + std::cout << " ISOLATED"; + else if (tree.info and tree.info->deleted) std::cout << " DELETED"; std::cout << '\n'; @@ -200,7 +205,7 @@ std::vector to_flat_notebook_list (const Node& tree) { } std::vector make_dele_list (const Node& tree) { - if (tree.info and tree.info->deleted) + if (tree.info and (tree.info->deleted or tree.info->isolated)) return to_flat_notebook_list(tree); std::vector retval;