src/csv_table_reader.cpp
//------------------------------------------------------------------------------
/*! \brief Constructor
 *
 *  Attempts to open the given file name.
 *
 *  \param fileName The name of a csv file to read from.
 *  \exception h_exception If there were errors when opening the file.
 */
\brief Constructor
Attempts to open the given file name.

\param fileName The name of a csv file to read from.
\exception h_exception If there were errors when opening the file.
\ brief Constructor Attempts to open the given file name . \ param fileName The name of a csv file to read from . \ exception h_exception If there were errors when opening the file .
CSVTableReader::CSVTableReader( const string& fileName ) throw ( h_exception )
:fileName( fileName )
{
    tableInputStream.exceptions( ifstream::failbit | ifstream:: badbit );
    try {
        tableInputStream.open( fileName.c_str() );
    } catch( ifstream::failure e ) {
        string errorStr = "Could not open csv file: "+fileName+" error: "+strerror(errno);
        H_THROW( errorStr );
    }
    lineNum = 0;
}
CSVTableReader :: CSVTableReader ( const string & fileName ) throw ( h_exception ) : fileName ( fileName ) { tableInputStream . exceptions ( ifstream :: failbit | ifstream :: badbit ) ; try { tableInputStream . open ( fileName . c_str ( ) ) ; } catch ( ifstream :: failure e ) { string errorStr = " " + fileName + " " + strerror ( errno ) ; H_THROW ( errorStr ) ; } lineNum = 0 ; }
\brief Constructor
  Attempts to open the given file name.
\ brief Constructor Attempts to open the given file name .
// allow exceptions from bad io operations // attempt to open the file // the macro errno in combination with strerror seem to be much more // informative than error message from the exception