Go to the documentation of this file.
39 int main(
int argc,
char *argv[])
43 " $HOME kjhkjhkjh \" \\$HOME/tyetyery $; ${FOAM_RUN} \n $; hkjh;"
44 " $(DONOTSUBST) some other <${USER}> with '${__UNKNOWN:-some default}'"
46 " or with '${HOME:+Home was set}' via :+ alternative"
47 " or with '${__UNKNOWN:+unknown}' empty"
54 subDict.
add(
"value1",
"test1");
55 subDict.
add(
"value2",
"test2");
68 string::const_iterator iter =
test.end();
69 string::const_iterator iter2 =
test.end();
72 if (fnd != string::npos)
74 iter =
test.begin() + fnd;
78 Info<<
"sub-string via iterators : >";
96 string test2(
"~OpenFOAM/controlDict");
103 if (i == string::npos)
110 test2.
replace(i+1, string::npos,
"newName");
112 Info<<
"after replace: " << test2 <<
endl;
116 test2.
replace(
"OpenFOAM",
"openfoam");
118 Info<<
"after replace: " << test2 <<
endl;
124 string s2(
s.expand());
126 cout<<
"output string with " << s2.length() <<
" characters\n";
127 cout<<
"ostream<< >" << s2 <<
"<\n";
128 Info<<
"Ostream<< >" << s2 <<
"<\n";
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
string & replaceAll(const string &oldStr, const string &newStr, size_type start=0)
Replace all occurences of sub-string oldStr with newStr.
string trimLeft(const string &)
Return string trimmed of leading whitespace.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A class for handling character strings derived from std::string.
ISstream & getLine(string &)
Raw, low-level getline into a string function.
graph_traits< Graph >::vertices_size_type size_type
A list of keyword definitions, which are a keyword followed by any number of values (e....
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
IOstream & hex(IOstream &io)
string trimRight(const string &)
Return string trimmed of trailing whitespace.
Hashing function class, shared by all the derived classes.
string & replace(const string &oldStr, const string &newStr, size_type start=0)
Replace first occurence of sub-string oldStr with newStr.
string & expand(const bool allowEmpty=false)
Expand initial tildes and all occurences of environment variables.
int main(int argc, char *argv[])
bool add(entry *, bool mergeEntry=false)
Add a new entry.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurences of variables according to the mapping.
string trim(const string &)
Return string trimmed of leading and trailing whitespace.