iceoryx_doc
1.0.1
|
Wrapper class for file reading operations. Tries to open a file in the constructor. Error handling strategy can be decided by means of the ErrorMode argument. More...
#include <file_reader.hpp>
Public Types | |
enum class | ErrorMode { Ignore , Inform , Terminate } |
Public Member Functions | |
FileReader (const std::string &f_fileName, const std::string &f_filePath="", ErrorMode f_errorMode=ErrorMode::Inform) | |
FileReader (const FileReader &)=delete | |
FileReader (FileReader &&)=delete | |
FileReader & | operator= (const FileReader &)=delete |
FileReader & | operator= (FileReader &&)=delete |
bool | IsOpen () const |
Check if the associated file is open. | |
bool | ReadLine (std::string &f_string) |
Read one line from the file and store the result in f_string. | |
Wrapper class for file reading operations. Tries to open a file in the constructor. Error handling strategy can be decided by means of the ErrorMode argument.
|
strong |
Error handling strategy. Ignore continues execution as if nothing happened. Inform continues, but prints an error message. Terminate causes the process to exit.
iox::cxx::FileReader::FileReader | ( | const std::string & | f_fileName, |
const std::string & | f_filePath = "" , |
||
ErrorMode | f_errorMode = ErrorMode::Inform |
||
) |
Opens a file and creates a FileReader object. The file path argument is optional and is ignored if empty. The error mode is evaluated when an error occurs.