-///////////////////////////////////////////////////////////////////////////
-// Because is not available in C++ (?)
-void 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);
+/**
+ * \ingroup Globals
+ * \brief Add a SEPARATOR to the end of the name is necessary
+ * @param name file/directory name to normalize
+ */
+std::string Util::NormalizePath(std::string const & pathname)
+{
+ const char SEPARATOR_X = '/';
+ const char SEPARATOR_WIN = '\\';
+ const std::string SEPARATOR = "/";
+ std::string name = pathname;
+ int size = name.size();
+
+ if( name[size-1] != SEPARATOR_X && name[size-1] != SEPARATOR_WIN )
+ {
+ name += SEPARATOR;