71template<
class T>
struct Hash;
87 inline static std::string::size_type
find_ext(
const std::string& str);
91 inline std::string::size_type
find_ext()
const;
94 template<
class PrimitiveType>
99 const PrimitiveType& val
103 template<
class PrimitiveType>
107 const std::string& fmt,
108 const PrimitiveType& val
125 inline bool hasExt()
const;
128 inline bool hasExt(
const char* ending)
const;
131 inline bool hasExt(
const std::string& ending)
const;
150 unsigned operator()(
const std::string& str,
unsigned seed=0)
const
170 static const string null;
179 inline string(
const std::string& str);
182 inline string(std::string&& str);
185 inline string(
const char* str);
191 inline explicit string(
const char c);
203 template<
class StringType>
204 static inline bool valid(
const std::string& str);
207 template<
class StringType>
211 template<
class StringType>
212 static inline StringType
validate(
const std::string& str);
219 inline bool match(
const std::string& text)
const;
222 using std::string::replace;
228 const std::string& s1,
229 const std::string& s2,
238 const std::string& s1,
239 const std::string& s2,
248 const std::string& s1,
259 string&
expand(
const bool allowEmpty =
false);
285 inline void swap(std::string& str);
292 inline bool operator()(
const std::string& text)
const;
300 return (size() >=
s.size() && !compare(0,
s.size(),
s));
306 return (!empty() && front() == c);
312 return (size() >=
s.size() && !compare(size()-
s.size(), npos,
s));
318 return (!empty() && back() == c);
Miscellaneous hashing functions, mostly from Bob Jenkins.
graph_traits< Graph >::vertices_size_type size_type
A character and a pointer to a character string.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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.
bool startsWith(const std::string &s) const
Deprecated(2019-11)
bool endsWith(const std::string &s) const
Deprecated(2019-11)
bool ends_with(const std::string &s) const
True if string ends with the given suffix (cf. C++20)
static bool valid(const std::string &str)
Does the string contain valid characters only?
size_type count(const char c) const
string()=default
Default construct.
static bool stripInvalid(std::string &str)
Strip invalid characters from the given string.
bool starts_with(const char c) const
True if string starts with the given character (cf. C++20)
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 starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
static StringType validate(const std::string &str)
Return a valid String from the given string.
bool removeTrailing(const char c)
Deprecated(2019-11)
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)
bool removeExt()
Remove extension, returning true if string changed.
word ext() const
Return file name extension (part after last .)
bool operator()(const std::string &text) const
Test for equality. Allows use as a predicate.
bool ends_with(const char c) const
True if string ends with the given character (cf. C++20)
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 std::string::size_type string_printf(std::string &output, const char *fmt, const PrimitiveType &val)
A printf-style formatter for a primitive.
void swap(std::string &str)
Swap contents. Self-swapping is a no-op.
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.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar pos(const dimensionedScalar &ds)
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Bob Jenkins's 96-bit mixer hashing function (lookup3)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Istream & operator>>(Istream &, directionInfo &)
static Ostream & output(Ostream &os, const IntRange< T > &range)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
Deprecated hashing functor - use hasher.
Hashing functor for string and derived string classes.
unsigned operator()(const std::string &str, unsigned seed=0) const