[Positioning] TextFileWriter throws error_opening_output_file
Fix mistake in TextFileWriter::TextFileWriter(), that thrown error_opening_input_file instead of error_opening_output_file. Creation of class error_opening_output_file in posexcept.
This commit is contained in:
parent
1a51d234c6
commit
866013248f
|
@ -119,6 +119,19 @@ const char* no_output_csv_file::what() const throw()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
error_opening_output_file::
|
||||||
|
error_opening_output_file(const string &_file_name) throw():
|
||||||
|
file_name(_file_name) {}
|
||||||
|
|
||||||
|
|
||||||
|
const char* error_opening_output_file::what() const throw()
|
||||||
|
{
|
||||||
|
string message = "Error opening output file « " +
|
||||||
|
file_name + " »!" ;
|
||||||
|
return message.c_str() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* *** Algorithms *** */
|
/* *** Algorithms *** */
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,18 @@ public:
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
class error_opening_output_file: public posexcept
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
std::string file_name ;
|
||||||
|
|
||||||
|
public:
|
||||||
|
error_opening_output_file(const std::string &_file_name) throw() ;
|
||||||
|
~error_opening_output_file(void) throw() {}
|
||||||
|
const char* what(void) const throw() ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* *** Algorithms *** */
|
/* *** Algorithms *** */
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ TextFileWriter::TextFileWriter(const string &_file_name):
|
||||||
{
|
{
|
||||||
file.open(file_name.c_str()) ;
|
file.open(file_name.c_str()) ;
|
||||||
if (! file)
|
if (! file)
|
||||||
throw error_opening_input_file(file_name) ;
|
throw error_opening_output_file(file_name) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue