--- trunk/src/mdParser/SimplePreprocessor.hpp 2005/12/02 15:38:03 770 +++ trunk/src/mdParser/SimplePreprocessor.hpp 2006/03/29 22:24:59 924 @@ -44,8 +44,13 @@ #include #include #include +#include #include "utils/StringTokenizer.hpp" #include "utils/Trim.hpp" +#include "utils/OOPSEException.hpp" +#include "utils/simError.h" + + /** * @class SimplePreprocessor * @brief A simple preprocessor. @@ -66,7 +71,19 @@ class SimplePreprocessor { private: bool doPreprocess(const std::string& filename, ostream& os, std::set& defineSet, std::stack& ifStates) { std::ifstream input(filename.c_str()); - + if (!input.is_open()) { + std::stringstream ss; + ss << "Can not open " << filename << " for preprocessing\n"; + + sprintf(painCave.errMsg, + "Can not open (%s) for processing. \n" + "\tPlease check md file name syntax.\n", filename.c_str()); + + painCave.isFatal = 1; + simError(); + + throw OOPSEException(ss.str()); + } int lineNo =1; os << "#line " << lineNo << " \"" << filename << "\"\n"; while(input.getline(buffer, bufferSize)) {