--- linuxsampler/trunk/src/common/global_private.h 2009/02/03 19:38:19 1831 +++ linuxsampler/trunk/src/common/global_private.h 2009/02/05 17:48:54 1832 @@ -28,7 +28,7 @@ #define __LS_GLOBAL_PRIVATE_H__ #include "global.h" - +#include "Exception.h" #include #if HAVE_CONFIG_H @@ -72,6 +72,13 @@ return ss.str(); } +inline int ToInt(const std::string& s) throw(LinuxSampler::Exception) { + int i; + std::istringstream iss(s); + if(!(iss >> i)) throw LinuxSampler::Exception("Not an integer"); + return i; +} + class Runnable { public: virtual ~Runnable() { }