Пример #1
0
 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;
 }
Пример #2
0
 Path::Ptr CreatePath(Char separator, Strings::Array data)
 {
   if (!data.empty())
   {
     return MakePtr<ParsedPath>(separator, std::move(data));
   }
   else
   {
     return MakePtr<EmptyPath>(separator);
   }
 }
Пример #3
0
 Path::Ptr ParsePath(const String& str, Char separator)
 {
   const Strings::Array parsed = SplitPath(str, separator);
   return CreatePath(separator, parsed.begin(), parsed.end());
 }