Go to the documentation of this file.
91 template<
class PrimitiveType>
96 const PrimitiveType& val
100 template<
class PrimitiveType>
104 const std::string& fmt,
105 const PrimitiveType& val
122 inline bool hasExt()
const;
148 static const string null;
154 inline unsigned operator()
156 const std::string& str,
168 inline string(
const std::string& str);
171 inline string(std::string&& str);
174 inline string(
const char* str);
180 inline explicit string(
const char c);
192 template<
class String>
193 static inline bool valid(
const std::string& str);
197 template<
class String>
198 static inline bool meta(
const std::string& str,
const char quote=
'\\');
201 template<
class String>
205 template<
class String>
206 static inline String
validate(
const std::string& str);
209 template<
class String>
212 const std::string& str,
213 const char quote =
'\\'
221 inline bool match(
const std::string& text)
const;
224 using std::string::replace;
230 const std::string& s1,
231 const std::string& s2,
240 const std::string& s1,
241 const std::string& s2,
250 const std::string& s1,
261 string&
expand(
const bool allowEmpty =
false);
287 inline void swap(std::string& str);
294 inline bool operator()(
const std::string& text)
const;
302 return (size() >=
s.size() && !compare(0,
s.size(),
s));
308 return (!empty() && front() ==
c);
314 return (size() >=
s.size() && !compare(size()-
s.size(), npos,
s));
320 return (!empty() && back() ==
c);
345 Istream&
operator>>(Istream& is,
string& val);
348 Ostream&
operator<<(Ostream& os,
const string& val);
351 Ostream&
operator<<(Ostream& os,
const std::string& val);
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 std::string::size_type string_printf(std::string &output, const char *fmt, const PrimitiveType &val)
A printf-style formatter for a primitive.
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.
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)
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 .)
Misc. hashing functions, mostly from Bob Jenkins.
bool starts_with(const char c) const
True if string starts with the given character (cf. C++20)
Hashing function for string and derived string classes.
static String validate(const std::string &str)
Return a valid String from the given string.
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?
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.
static bool meta(const std::string &str, const char quote='\\')
Does this string contain meta-characters?
bool startsWith(const std::string &s) const
Deprecated(2019-11)
size_type count(const char c) const
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
Construct null.
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.
static string quotemeta(const std::string &str, const char quote='\\')
Return a String with quoted meta-characters from the given string.
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.
dimensionedScalar pos(const dimensionedScalar &ds)