Function husarion_ugv_utils::common_utilities::OpenFile

Function Documentation

inline std::fstream husarion_ugv_utils::common_utilities::OpenFile(const std::string &file_path, const std::ios_base::openmode &mode)

Opens a file with the specified mode.

This function opens a file with the specified mode and returns a std::fstream object. If the file fails to open, it throws a std::runtime_error.

Parameters:
  • file_path – The path to the file to be opened.

  • mode – The mode in which the file should be opened (e.g., std::ios_base::in | std::ios_base::out).

Throws:

std::runtime_error – if the file fails to open.

Returns:

std::fstream The opened file stream.