MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / list_obj

Function list_obj

examples/cpp_api/object.cc:67–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67int list_obj(const std::string& path) {
68 // Create TileDB context
69 tiledb::Context ctx;
70
71 // List children
72 std::cout << "\nListing hierarchy: \n";
73 tiledb::ObjectIter obj_iter(ctx, path);
74 for (const auto& object : obj_iter)
75 print_path(object.uri(), object.type());
76
77 // Walk in a path with a pre- and post-order traversal
78 std::cout << "\nPreorder traversal: \n";
79 obj_iter.set_recursive(); // Default order is preorder
80 for (const auto& object : obj_iter)
81 print_path(object.uri(), object.type());
82 std::cout << "\nPostorder traversal: \n";
83 obj_iter.set_recursive(TILEDB_POSTORDER);
84 for (const auto& object : obj_iter)
85 print_path(object.uri(), object.type());
86
87 return 0;
88}
89
90void create_array(const std::string& array_name, tiledb_array_type_t type) {
91 Context ctx;

Callers 1

mainFunction · 0.70

Calls 4

set_recursiveMethod · 0.80
print_pathFunction · 0.70
uriMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected