33 const auto i = str.find_last_of(
"./");
35 if (i == npos || i == 0 || str[i] ==
'/')
46 return find_ext(*
this);
52 return (npos != find(
'/'));
58 return (npos != find_ext());
70 const auto len = ending.size();
72 if (i == npos || !len)
78 return ((size() - i) == len) && !compare(i, npos, ending);
84 const auto i = rfind(
'/');
98 const auto i = find_ext();
121 std::
string(std::move(str))
151template<
class StringType>
154 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
156 if (!StringType::valid(*iter))
166template<
class StringType>
169 if (!string::valid<StringType>(str))
172 iterator outIter = str.begin();
174 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
176 const char c = *iter;
178 if (StringType::valid(c))
195template<
class StringType>
199 out.resize(str.size());
202 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
204 const char c = *iter;
205 if (StringType::valid(c))
220 return !compare(text);
229 std::string::swap(str);
238 return !compare(text);
graph_traits< Graph >::vertices_size_type size_type
bool valid() const
True if all internal ids are non-negative.
Ostream & operator()() const
Output stream (master only).
void stripInvalid()
Strip invalid characters.
virtual void validate()
Validate the turbulence fields after construction.
A class for handling character strings derived from std::string.
string()=default
Default construct.
std::string::size_type find_ext() const
Find position of a file extension dot, return npos on failure.
bool removePath()
Remove leading path, returning true if string changed.
bool hasPath() const
Return true if it contains a '/' character.
bool match(const std::string &text) const
Test for equality.
bool removeExt()
Remove extension, returning true if string changed.
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.