#include "WaferBasis.h" WaferBasis::WaferBasis(void) { _error = true; _warning = true; _info = false; _debug = false; } WaferBasis::~WaferBasis(void) { } void WaferBasis::setSourceFileName(std::string pSourceFileName){ pSourceFileName.replace(0,2,""); //get rid of the .\ in the file name pSourceFileName = pSourceFileName.substr(0,pSourceFileName.find_last_of(".")); //get rid of the .cxx in the file name _sourceFileName = pSourceFileName; } void WaferBasis::setErrorOutput(bool pToggle) { _error = pToggle; } void WaferBasis::setWarningOutput(bool pToggle) { _warning = pToggle; } void WaferBasis::setInfoOutput(bool pToggle) { _info = pToggle; } void WaferBasis::setDebugOutput(bool pToggle) { _debug = pToggle; } void WaferBasis::debug(std::string pText, int pLine){ if (_debug){ if (pLine == -1) std::cout<<"\tdebug "<<_sourceFileName<<"::"<::has_infinity && pValue == std::numeric_limits::infinity(); } bool WaferBasis::isNan(double pValue) { return pValue != pValue; } bool WaferBasis::isFinite(double pValue) { return !isInf(pValue) && !isNan(pValue); } bool WaferBasis::fileExists(std::string& pFileName) { std::ifstream tFile(pFileName.c_str()); return (tFile != 0); } double WaferBasis::StrToDouble(std::string const& pValue) { std::istringstream tValue(pValue); double tDoubleValue; if (!(tValue>>tDoubleValue)){ error(std::string("StrToDouble(std::string const& pValue): Not a valid double value set: ").append(pValue)); return -1; } return tDoubleValue; } std::string WaferBasis::DoubleToStr(double const& pValue){ std::stringstream tValue; tValue << pValue; return tValue.str(); }