\brief check if the file exists \param name the name of the file
| 196 | /// \brief check if the file exists |
| 197 | /// \param name the name of the file |
| 198 | inline void check_arg_file_exists(std::string name) { |
| 199 | // Attempt to open the file |
| 200 | std::ifstream file(name); |
| 201 | |
| 202 | // Check if the file was successfully opened |
| 203 | if (!file) { |
| 204 | throw std::runtime_error("Error: File '" + name + "' does not exist or cannot be opened."); |
| 205 | } |
| 206 | |
| 207 | // Optionally, close the file (not strictly necessary, as ifstream will close on destruction) |
| 208 | file.close(); |
| 209 | } |
| 210 | |
| 211 | |
| 212 | /// \brief print the npu profile |
nothing calls this directly
no outgoing calls
no test coverage detected