using namespace std;
-ParserException::ParserException(string msg) throw()
+ParserException::ParserException(string msg) noexcept
: exception(),
_msg(msg)
{
}
-ParserException::~ParserException() throw()
+ParserException::~ParserException() noexcept
{
}
-const char * ParserException::what() const throw()
+const char * ParserException::what() const noexcept
{
return _msg.c_str();
}
-SimpleParser::SimpleParser() throw()
+SimpleParser::SimpleParser() noexcept
{
}
-SimpleParser::~SimpleParser() throw()
+SimpleParser::~SimpleParser() noexcept
{
}
-std::string SimpleParser::trim(const std::string & str) const throw()
+std::string SimpleParser::trim(const std::string & str) const noexcept
{
size_t beg = str.find_first_not_of(" \t");
if (beg == string::npos) beg = 0;
return str.substr(beg, end-beg+1);
}
-void SimpleParser::parse(const string & filename) throw(ParserException)
+void SimpleParser::parse(const string & filename)
{
ifstream fileStream(filename.c_str());
if (!fileStream) {
fileStream.close();
}
-void SimpleParser::parseTestConfigFile() throw(ParserException)
+void SimpleParser::parseTestConfigFile()
{
char * filename = getenv(TEST_CONFIG_FILE_ENV_VAR);
if (filename == NULL) {
}
}
-const string & SimpleParser::getValue(const string & key) const throw(ParserException)
+const string & SimpleParser::getValue(const string & key) const
{
map<string,string>::const_iterator iter = _configmap.find(key);
if (iter == _configmap.end()) {
}
const string & SimpleParser::getTestValue(const string & bmType, const string & protocolStr,
- const string & key) const throw(ParserException)
+ const string & key) const
{
string fullkey = string("TEST_") + bmType + "_" + protocolStr + "_" + key;
try {
return getValue(fullkey);
}
-int SimpleParser::getValueAsInt(const string & key) const throw(ParserException)
+int SimpleParser::getValueAsInt(const string & key) const
{
const string & valueStr = getValue(key);
const char * valueCStr = valueStr.c_str();
}
int SimpleParser::getTestValueAsInt(const string & bmType, const string & protocolStr,
- const string & key) const throw(ParserException)
+ const string & key) const
{
string fullkey = string("TEST_") + bmType + "_" + protocolStr + "_" + key;
try {
return getValueAsInt(fullkey);
}
-ostream & operator <<(ostream & os, const SimpleParser & parser) throw()
+ostream & operator <<(ostream & os, const SimpleParser & parser) noexcept
{
if (parser._configmap.empty()) {
os << "Empty map" << endl;