| 65 | } |
| 66 | |
| 67 | int 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 | |
| 90 | void create_array(const std::string& array_name, tiledb_array_type_t type) { |
| 91 | Context ctx; |
no test coverage detected