Go to the documentation of this file.
71 template<
class T>
struct Hash;
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);
string & replace(const std::string &s1, const std::string &s2, size_type pos=0)
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 '.'.
static Ostream & output(Ostream &os, const IntRange< T > &range)
static std::string::size_type string_printf(std::string &output, const char *fmt, const PrimitiveType &val)
A printf-style formatter for a primitive.
unsigned operator()(const std::string &str, unsigned seed=0) const
A class for handling words, derived from Foam::string.
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))
bool removeExt()
Remove extension, returning true if string changed.
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Bob Jenkins's 96-bit mixer hashing function (lookup3)
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
bool operator()(const std::string &text) const
Test for equality. Allows use as a predicate.
Istream & operator>>(Istream &, directionInfo &)
A class for handling character strings derived from std::string.
bool endsWith(const std::string &s) const
Deprecated(2019-11)
static const char *const typeName
The type name "string".
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
static int debug
The debug flag.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
bool match(const std::string &text) const
Test for equality.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word ext() const
Return file name extension (part after last .)
Miscellaneous hashing functions, mostly from Bob Jenkins.
bool starts_with(const char c) const
True if string starts with the given character (cf. C++20)
Deprecated hashing functor - use hasher.
graph_traits< Graph >::vertices_size_type size_type
string & replaceAny(const std::string &s1, const char c2, size_type pos=0)
bool hasPath() const
Return true if it contains a '/' character.
bool ends_with(const char c) const
True if string ends with the given character (cf. C++20)
bool removeRepeated(const char character)
Remove repeated characters.
static bool valid(const std::string &str)
Does the string contain valid characters only?
OBJstream os(runTime.globalPath()/outputName)
bool removeTrailing(const char c)
Deprecated(2019-11)
string & replaceAll(const std::string &s1, const std::string &s2, size_type pos=0)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
bool removePath()
Remove leading path, returning true if string changed.
bool startsWith(const std::string &s) const
Deprecated(2019-11)
size_type count(const char c) const
Hashing functor for string and derived string classes.
bool ends_with(const std::string &s) const
True if string ends with the given suffix (cf. C++20)
string & expand(const bool allowEmpty=false)
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.
bool removeStart(const std::string &text)
Remove the given text from the start of the string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool removeEnd(const std::string &text)
Remove the given text from the end of the string.
A character and a pointer to a character string.
static StringType validate(const std::string &str)
Return a valid String from the given string.
dimensionedScalar pos(const dimensionedScalar &ds)