10#ifndef TEUCHOS_STRUTILS_H
11#define TEUCHOS_STRUTILS_H
43 static bool readLine(std::istream& is, std::string& line);
65 const std::string& varName,
66 const std::string& varValue);
75 static std::string
before(
const std::string& str,
const std::string& sub);
79 static std::string
before(
const std::string& str,
char sub);
83 static std::string
after(
const std::string& str,
const std::string& sub);
87 static int find(
const std::string& str,
const std::string& sub);
90 static bool isWhite(
const std::string& str);
103 static std::string between(
const std::string& str,
const std::string& begin,
104 const std::string& end, std::string& front, std::string& back);
109 static std::string subString(
const std::string& str,
int begin,
int end);
111 static std::string readFromStream(std::istream& is);
114 static std::string allCaps(
const std::string& str);
117 static double atof(
const std::string& str);
120 static int atoi(
const std::string& str);
123 static std::ostream& printLines(
125 ,
const std::string &linePrefix
126 ,
const std::string &lines
130 static std::string removeAllSpaces(std::string stringToClean);
Templated array class derived from the STL std::vector.
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
A utilities class for Teuchos.
Replacement for std::vector that is compatible with the Teuchos Memory Management classes.
Provides std::string manipulation utilities that are not provided in the standard C++ std::string cla...
static int findNextNonWhitespace(const std::string &str, int offset)
static int find(const std::string &str, const std::string &sub)
Find the position at which a substring first occurs. For example, find("abcdefghij",...
static Array< std::string > splitIntoLines(const std::string &input)
Split an input std::string that contains newlines into an array of strings, one for each line.
static std::string varSubstitute(const std::string &rawLine, const std::string &varName, const std::string &varValue)
static std::string after(const std::string &str, const std::string &sub)
Find the substring after a specified substring. For example, before("abcdefghij", "gh") returns "ij".
static int findNextWhitespace(const std::string &str, int offset)
static Array< std::string > getTokensPlusWhitespace(const std::string &str)
static void splitList(const std::string &bigstring, Array< std::string > &elements)
static std::string fixUnprintableCharacters(const std::string &str)
Convert unprintable non-null characters to whitespace.
static Array< Array< std::string > > tokenizeFile(std::istream &is, char comment)
Tokenize a file into whitespace-delimited tokens.
static std::string reassembleFromTokens(const Array< std::string > &tokens, int iStart=0)
static Array< std::string > stringTokenizer(const std::string &str)
static Array< std::string > readFile(std::istream &is, char comment)
Read a file, putting each line into a std::string.
static bool isNonWhite(const std::string &str)
Returns true if a std::string has any non-whitespace.
static bool isWhite(const std::string &str)
Returns true if a std::string consists entirely of whitespace.
static bool readLine(std::istream &is, std::string &line)
Read a single line into a std::string.
static std::string varTableSubstitute(const std::string &rawLine, const Array< std::string > &varNames, const Array< std::string > &varValues)
static std::string before(const std::string &str, const std::string &sub)
Find the substring before a specified substring. For example, before("abcdefghij",...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...