78 template<
class String>
81 for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
83 if (!String::valid(*iter))
92 template<
class String>
95 if (!valid<String>(str))
98 iterator iter2 = str.begin();
102 const_iterator iter1 = iter2;
103 iter1 !=
const_cast<const string&
>(str).end();
109 if (String::valid(c))
126 template<
class String>
130 for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
132 if (quote && *iter == quote)
140 else if (String::meta(*iter))
149 template<
class String>
159 sQuoted.reserve(2*str.length());
162 for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
172 else if (String::meta(*iter))
180 sQuoted.resize(sQuoted.length());
186 template<
class String>
190 stripInvalid<String>(ss);
197 return (str == *
this);
219 inline unsigned Foam::string::hash::operator()
225 return Hasher(key.data(), key.size(), seed);
231 std::string::operator=(str);
237 std::string::operator=(move(str));
static bool meta(const string &, const char quote='\\')
Does this string have particular meta-characters?
string operator()(const size_type i, const size_type n) const
Return the sub-string from the i-th character for n characters.
static String validate(const string &)
Return a valid String from the given string.
const dimensionedScalar & c
Speed of light in a vacuum.
bool match(const std::string &) const
True when strings match literally.
static string quotemeta(const string &, const char quote='\\')
Return a String with quoted meta-characters from the given string.
graph_traits< Graph >::vertices_size_type size_type
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Bob Jenkins's 96-bit mixer hashing function (lookup3)
void operator=(const string &)
static bool valid(const string &)
Is this string type valid?
static bool stripInvalid(string &)
Strip invalid characters from the given string.
A class for handling character strings derived from std::string.