7c7
< #include <stdexcept> // logic_error
---
> #include <iostream>
9c9
< #include "FssimApp.h"
---
> #include "FssimUtil.h"
11c11,12
< #include "FileException.h"
---
> #include "OpenException.h"
> #include "DataNotFoundException.h"
12a14,16
> class FssimApp;
> class Data; // forward declare for member function pointer
> 
15d18
< class Data; // forward declare for member function pointer
22,24c25,33
<     enum { FILESTREAM_CHUNK_SIZE = 255 };
<     Data(const string& inputDatafileDirectory);
<     static int processDataFile(const char* functionName, PDataMemberFn pMemberFunction, Data& pObj);
---
>     enum { FILESTREAM_CHUNK_SIZE = FssimUtil::MAX_PATH_LENGTH };
> 
>     Data(const string& inputDatafileDirectory)
>         :  m_pApp(FssimApp::getApp()), m_dataPath(inputDatafileDirectory)
>     {
>         assert(m_pApp);
>     }
> 
>     static void processDataFile(const char* functionName, const PDataMemberFn pMemberFunction, Data& pObj);
36c45
<     void read_axs();
---
>     void read_axs() throw (OpenException); // axs file may not exist
48c57
<     void read_class_error(int line_no, const char *str);
---
>     void read_class_error(const char *str);
49a59,62
>     const int getLineNumber() const { return m_lineNumber; }
>     const string& getFileName() const { return m_fileName; }
>     void setFileName(const string& fileName) { m_fileName = fileName; }
> 
54c67
<     bool parseData();
---
>     bool parseData() throw (DataNotFoundException);
56c69
<     void doConfigToggle(bool& toggle, const string& toggleName, bool defaultValue = true);
---
>     void doConfigToggle(bool& toggle, const string& toggleName, const bool defaultValue = true);
61a75,77
>     // exception handling utility functions
>     void throwLabelTooLong(const string& labelType);
>     void discardInvalidDataLine();
72a89,90
>     int m_lineNumber;
>     int m_fieldCount;
76a95
>     m_lineNumber = 1;
87c106
< #ifdef _TSB_READ_CONFIG_DEBUG
---
> #ifdef _TSB_READ_CONFIG_DEBUG_OFF
93c112
< #ifdef _TSB_READ_CONFIG_DEBUG
---
> #ifdef _TSB_READ_CONFIG_DEBUG_OFF
98a118
>         m_lineNumber++; // get next line
115c135
< inline bool Data::parseData()
---
> inline bool Data::parseData() throw (DataNotFoundException)
122c142
< #ifdef _TSB_READ_CONFIG_DEBUG
---
> #ifdef _TSB_READ_CONFIG_DEBUG_OFF
127c147
< #ifdef _TSB_READ_CONFIG_DEBUG
---
> #ifdef _TSB_READ_CONFIG_DEBUG_OFF
131c151
<     if (m_dataString.length() == 0)
---
>     if (m_dataString.length() == 0) // data parse failed
133,137c153
<         cout << endl << endl << "WARNING: " << m_fileName.c_str()
<              << ": Could not find " << m_lineLabel
<              << " field; using default value(" << m_defaultValueString << ")" << endl << endl;
< 
<         return false; // data parse failed
---
>         throw DataNotFoundException("config field", m_lineLabel, m_defaultValueString, false /* not fatal */);
142c158
< inline void Data::doConfigToggle(bool& toggle, const string& toggleName, bool defaultValue)
---
> inline void Data::doConfigToggle(bool& toggle, const string& toggleName, const bool defaultValue)
144c160
<     if (!this->parseData()) // if the line is missing, use default
---
>     try
146,149c162,163
<         toggle = defaultValue;
<     }
<     else
<     {
---
>         this->parseData(); // if the line is missing, use default
> 
160,163c174,176
<             string message = "ERROR: " + toggleName;
<             message += " MUST be one of [On/Off]\n\tFilename: ............ %s";
<             message += m_fileName;
<             throw logic_error(message);
---
>             string message = toggleName;
>             message += " MUST be one of [On/Off]";
>             throw InvalidDataException(m_dataString, message);
165a179,188
>     catch(DataNotFoundException& e)
>     {
>         toggle = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
>     catch(InvalidDataException& e)
>     {
>         toggle = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
178c201
<     if (!this->parseData()) // if the line is missing, use default
---
>     try
180,183c203,204
<         number = defaultValue;
<     }
<     else
<     {
---
>         this->parseData(); // if the line is missing, use default
> 
193c214
<             throw logic_error(message);
---
>             throw InvalidDataException(m_dataString, message);
195a217,226
>     catch(DataNotFoundException& e)
>     {
>         number = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
>     catch(InvalidDataException& e)
>     {
>         number = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
200c231
<     if (!this->parseData()) // if the line is missing, use default
---
>     try
202,205c233,234
<         number = defaultValue;
<     }
<     else
<     {
---
>         this->parseData(); // if the line is missing, use default
> 
215c244
<             throw logic_error(message);
---
>             throw InvalidDataException(number, message);
217a247,256
>     catch(DataNotFoundException& e)
>     {
>         number = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
>     catch(InvalidDataException& e)
>     {
>         number = defaultValue;
>         cerr << endl << e.what() << endl;
>     }
219d257
< 
