60 if (ending.empty() || empty() || back() ==
'/')
64 else if (ending[0] ==
'.')
66 if (ending.size() == 1)
85 return hasExt(
static_cast<const std::string&
>(ending));
88 const auto i = find_ext();
95 return ending.
match(substr(i+1));
109 const std::string& s1,
110 const std::string& s2,
114 if ((
pos = find(s1,
pos)) != npos)
116 std::string::replace(
pos, s1.size(), s2);
125 const std::string& s1,
126 const std::string& s2,
130 const auto n1 = s1.length();
131 const auto n2 = s2.length();
135 while ((
pos = find(s1,
pos)) != npos)
137 std::string::replace(
pos, n1, s2);
148 const std::string& s1,
155 while ((
pos = find_first_of(s1,
pos)) != npos)
159 operator[](
pos) = c2;
182 bool changed =
false;
184 if (character && find(character) != npos)
187 iterator outIter = begin();
191 for (
auto iter = cbegin(); iter != cend(); ++iter)
193 const char c = *iter;
195 if (prev == c && c == character)
216 const auto txtLen = text.length();
217 const auto strLen = length();
219 if (txtLen && strLen >= txtLen && !compare(0, txtLen, text))
231 const auto txtLen = text.length();
232 const auto strLen = length();
234 if (txtLen && strLen >= txtLen && !compare(strLen - txtLen, npos, text))
236 erase(strLen - txtLen);
246 if (length() > 1 && front() == c)
258 const auto n = length();
259 if (
n > 1 && back() == c)
graph_traits< Graph >::vertices_size_type size_type
label size_type
The type to represent the size of a buffer.
A class for handling character strings derived from std::string.
bool removeStart(const std::string &text)
Remove the given text from the start of the string.
static const string null
An empty string.
std::string::size_type find_ext() const
Find position of a file extension dot, return npos on failure.
string & replaceAll(const std::string &s1, const std::string &s2, size_type pos=0)
bool removeRepeated(const char character)
Remove repeated characters.
string & expand(const bool allowEmpty=false)
word ext() const
Return file name extension (part after last .)
string & replaceAny(const std::string &s1, const char c2, size_type pos=0)
static int debug
The debug flag.
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
bool hasExt() const
Return true if it has an extension or simply ends with a '.'.
static const char *const typeName
The type name "string".
bool removeEnd(const std::string &text)
Remove the given text from the end of the string.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
bool isLiteral() const noexcept
The wordRe is a literal string, not a pattern.
bool match(const std::string &text, bool literal=false) const
Smart match as regular expression or as a string.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
void inplaceExpand(std::string &s, const HashTable< string > &mapping, const char sigil='$')
std::string::size_type count(const std::string &s, const char c)
Count the number of occurrences of the specified character.
dimensionedScalar pos(const dimensionedScalar &ds)