#include <iostream>
#include <dai/properties.h>
#include <dai/alldai.h>
+#include <dai/exceptions.h>
namespace dai {
os << boost::any_cast<LC::Properties::UpdateType>(p.second);
#endif
else
- throw "Unknown property type";
+ DAI_THROW(UNKNOWN_PROPERTY_TYPE);
return( os );
}
// Check whether s is of the form "[.*]"
if( (s.length() < 2) || (s.at(0) != '[') || (s.at(s.length()-1)) != ']' )
- throw "Malformed property";
+ DAI_THROW(MALFORMED_PROPERTY);
size_t N = s.length() - 1;
for( size_t token_start = 1; token_start < N; ) {
if( s[token_end] == '=' )
break;
if( token_end == N )
- throw "Malformed property key";
+ DAI_THROW(MALFORMED_PROPERTY);
// we found a key
std::string key = s.substr(token_start, token_end - token_start);
break;
}
if( !(level == 0) )
- throw "Malformed property value";
+ DAI_THROW(MALFORMED_PROPERTY);
// we found a vlue
std::string value = s.substr(token_start, token_end - token_start);