Go to the documentation of this file.
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))
151 template<
class StringType>
154 for (
auto iter = str.cbegin(); iter != str.cend(); ++iter)
156 if (!StringType::valid(*iter))
166 template<
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))
195 template<
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);
std::string::size_type find_ext() const
Find position of a file extension dot, return npos on failure.
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
bool removeExt()
Remove extension, returning true if string changed.
bool operator()(const std::string &text) const
Test for equality. Allows use as a predicate.
A class for handling character strings derived from std::string.
bool match(const std::string &text) const
Test for equality.
graph_traits< Graph >::vertices_size_type size_type
bool hasPath() const
Return true if it contains a '/' character.
static bool valid(const std::string &str)
Does the string contain valid characters only?
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
bool removePath()
Remove leading path, returning true if string changed.
static bool stripInvalid(std::string &str)
Strip invalid characters from the given string.
string()=default
Default construct.
const dimensionedScalar c
Speed of light in a vacuum.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.
static StringType validate(const std::string &str)
Return a valid String from the given string.