|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
Functions | |
| std::string | ensure_extension (std::string const &path) |
| Ensure a file path ends with the ".json" extension. | |
| nlohmann::json | read_file (std::string const &path, ErrorHandler on_error=invariant) |
| Read a JSON file and parse its contents. | |
| void | write_file (nlohmann::json const &data, std::string const &path, ErrorHandler on_error=invariant) |
| Write a JSON object to a file (pretty-printed with indent 2). | |
| std::string ppforest2::io::json::ensure_extension | ( | std::string const & | path | ) |
Ensure a file path ends with the ".json" extension.
| path | The original file path. |
| nlohmann::json ppforest2::io::json::read_file | ( | std::string const & | path, |
| ErrorHandler | on_error = invariant ) |
Read a JSON file and parse its contents.
| path | The input file path. |
| on_error | Error handler for file/parse failures. Defaults to invariant(); pass user_error for user-provided paths. |
| void ppforest2::io::json::write_file | ( | nlohmann::json const & | data, |
| std::string const & | path, | ||
| ErrorHandler | on_error = invariant ) |
Write a JSON object to a file (pretty-printed with indent 2).
| data | The JSON object to serialize. |
| path | The output file path. |
| on_error | Error handler for file failures. Defaults to invariant(); pass user_error for user-provided paths. |