-void gdcmDebug::Error( bool Test, const char * Msg1, const char * Msg2) {
- if (!Test)
- return;
- std::cerr << Msg1 << ' ' << Msg2 << std::endl;
- Exit(1);
+/**
+ * \ingroup Globals
+ * \brief Because not available in C++ (?)
+ */
+void Util::Tokenize (const std::string& str,
+ std::vector<std::string>& tokens,
+ const std::string& delimiters)
+{
+ std::string::size_type lastPos = str.find_first_not_of(delimiters,0);
+ std::string::size_type pos = str.find_first_of (delimiters,lastPos);
+ while (std::string::npos != pos || std::string::npos != lastPos)
+ {
+ tokens.push_back(str.substr(lastPos, pos - lastPos));
+ lastPos = str.find_first_not_of(delimiters, pos);
+ pos = str.find_first_of (delimiters, lastPos);
+ }