* Factory function to load a profile from the local file. * * @param name The profile name if you want to override the default. * @param dir The directory path that contains the profiles file. * @return A Profile object loaded from the file. */
| 110 | * @return A Profile object loaded from the file. |
| 111 | */ |
| 112 | static Profile load( |
| 113 | std::optional<std::string> name = std::nullopt, |
| 114 | std::optional<std::string> dir = std::nullopt) { |
| 115 | // create a profile object |
| 116 | Profile profile(name, dir); |
| 117 | |
| 118 | // load the profile |
| 119 | tiledb_error_t* capi_error = nullptr; |
| 120 | int rc = tiledb_profile_load(profile.profile_.get(), &capi_error); |
| 121 | if (rc != TILEDB_OK) { |
| 122 | const char* msg_cstr; |
| 123 | tiledb_error_message(capi_error, &msg_cstr); |
| 124 | std::string msg = msg_cstr; |
| 125 | tiledb_error_free(&capi_error); |
| 126 | throw ProfileException(msg); |
| 127 | } |
| 128 | return profile; |
| 129 | } |
| 130 | |
| 131 | /** Returns the C TileDB profile object. */ |
| 132 | std::shared_ptr<tiledb_profile_t> ptr() const { |
nothing calls this directly
no test coverage detected