33 const auto i = str.find_last_of(
"./");
35 if (i == npos || i == 0 || str[i] ==
'/')
46 return find_ext(*
this);
52 return (std::string::npos != find_ext());
58 const auto n1 = size();
59 const auto n2 = strlen(ending);
65 &&
operator[](n1-n2-1) ==
'.' 66 && !compare(n1-n2, npos, ending, n2)
73 const auto n1 = size();
74 const auto n2 = ending.size();
80 &&
operator[](n1-n2-1) ==
'.' 81 && !compare(n1-n2, npos, ending)
88 const auto i = rfind(
'/');
102 const auto i = find_ext();
155 template<
class StringType>
158 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
160 if (!StringType::valid(*iter))
170 template<
class StringType>
173 if (!string::valid<StringType>(str))
176 iterator outIter = str.begin();
178 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
180 const char c = *iter;
182 if (StringType::valid(
c))
199 template<
class StringType>
203 out.resize(str.size());
206 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
208 const char c = *iter;
209 if (StringType::valid(
c))
224 return !compare(text);
233 std::string::swap(str);
242 return !compare(text);
std::string::size_type find_ext() const
Find position of a file extension dot, return npos on failure.
bool operator()(const std::string &text) const
Test for equality. Allows use as a predicate.
bool match(const std::string &text) const
Test for equality.
bool has_ext() const
Return true if it has an extension or simply ends with a '.'.
static bool valid(const std::string &str)
Does the string contain valid characters only?
graph_traits< Graph >::vertices_size_type size_type
static bool stripInvalid(std::string &str)
Strip invalid characters from the given string.
bool remove_path()
Remove leading path, return true if string changed.
const dimensionedScalar c
Speed of light in a vacuum.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.
A class for handling character strings derived from std::string.
string()=default
Default construct.
static StringType validate(const std::string &str)
Return a valid String from the given string.
bool remove_ext()
Remove extension, return true if string changed.