Strings::Array SplitPath(const String& str, Char separator) { const String delimiter(1, separator); Strings::Array parts; boost::algorithm::split(parts, str, boost::algorithm::is_any_of(delimiter), boost::algorithm::token_compress_on); const Strings::Array::iterator newEnd = std::remove_if(parts.begin(), parts.end(), std::mem_fun_ref(&String::empty)); parts.erase(newEnd, parts.end()); return parts; }
Path::Ptr ParsePath(const String& str, Char separator) { const Strings::Array parsed = SplitPath(str, separator); return CreatePath(separator, parsed.begin(), parsed.end()); }