11#include "Teuchos_Assert.hpp" 
   37  for (
size_t p=0; 
p<
len; ++
p) {
 
 
   52    typedef std::string::size_type size_type;
 
   57      if (
cur_pos == std::string::npos) {
 
 
   81    if (
lines[
i].length() == 0) 
continue;
 
   83    if (tokens.length() == 0) 
continue;
 
 
   95  if (line.length() > 0) line[0] = 
'\0';
 
   97  if (
is.eof()) 
return false;
 
   98  if (
is.getline(
c, 499))
 
  100    line = std::string(
c);
 
 
  109  unsigned int start = 0;
 
  111  while(start < 
str.length())
 
  122    if (start-stop == 0) 
return rtn;
 
 
  133  unsigned int start = 0;
 
  135  while(start < 
str.length())
 
  139    if (start-stop == 0) 
return rtn;
 
 
  153  for (
int i=
iStart; 
i<tokens.length(); 
i++)
 
  156    if (
i < (tokens.length()-1)) 
rtn += 
" ";
 
 
  178  for (
unsigned int i=1; 
i<
big.length(); 
i++)
 
 
  214  return static_cast<int>(
str.length());
 
 
  227  return static_cast<int>(
str.length());
 
 
  237    "mismatched variable tables in varTableSubstitute");
 
 
  277    std::runtime_error, 
"String::before: arg is null pointer");
 
  279  char* 
p = std::strstr((
char*) 
str.c_str(), (
char*) 
sub.c_str());
 
  280  if (
p==0) 
return str;
 
 
  290    std::runtime_error, 
"String::after: arg is null pointer");
 
  293  char* 
p = std::strstr((
char*) 
str.c_str(), (
char*) 
sub.c_str()) ;
 
  295  if (
p==0) 
return std::string();
 
  297  p+= std::strlen(
sub.c_str());
 
  298  return std::string(
p);
 
 
  304  char* 
p = std::strstr((
char*) 
str.c_str(), (
char*) 
sub.c_str());
 
  306  return static_cast<int>(
p-
str.c_str());
 
 
  312  for (
unsigned int i=0; 
i<
str.length(); 
i++)
 
  314    unsigned char c = 
str[
i];
 
  315    if (
c >= 33 && 
c <= 126)
 
 
  327  for (
unsigned int i=0; 
i<
rtn.length(); 
i++)
 
  329    unsigned char c = 
rtn[
i];
 
  332      if (
c != 
'\t' && 
c != 
'\n'&& 
c != 
'\r' && 
c != 
'\f' && 
c != 
' ')
 
 
  343  const std::string& end, std::string& front,
 
 
  355  return std::string(
str.c_str()+begin, end-begin);
 
 
  359std::string StrUtils::readFromStream(std::istream& )
 
  362    "StrUtils::readFromStream isn't implemented yet");
 
  379  for (
unsigned int i=0; 
i<
rtn.length(); 
i++)
 
 
  389        return std::atof(
s.c_str());
 
 
  395        return std::atoi(
s.c_str());
 
 
  402  ,
const std::string       &
lines 
 
  417  std::string::size_type 
pos=0;
 
  422    if(
pos != string::npos){
 
 
A std::string utilities class for Teuchos.
 
Smart reference counting pointer class for automatic garbage collection.
 
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::ostream & printLines(std::ostream &os, const std::string &linePrefix, const std::string &lines)
Print lines with prefix first.
 
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 subString(const std::string &str, int begin, int end)
Returns the substring between two positions.
 
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 double atof(const std::string &str)
Returns the double value of a std::string.
 
static std::string between(const std::string &str, const std::string &begin, const std::string &end, std::string &front, std::string &back)
Returns the std::string between two delimiting strings, and returns by reference the strings before a...
 
static std::string reassembleFromTokens(const Array< std::string > &tokens, int iStart=0)
 
static Array< std::string > stringTokenizer(const std::string &str)
 
static std::string allCaps(const std::string &str)
Converts a std::string to all upper case.
 
static Array< std::string > readFile(std::istream &is, char comment)
Read a file, putting each line into a std::string.
 
static std::string removeAllSpaces(std::string stringToClean)
Removes all the spaces in a string.
 
static bool isWhite(const std::string &str)
Returns true if a std::string consists entirely of whitespace.
 
static int atoi(const std::string &str)
Returns the int value of a std::string.
 
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 Array< std::string > splitString(const std::string_view s, const char sep=',')
Split an input std::string using a seperator char sep.
 
static std::string before(const std::string &str, const std::string &sub)
Find the substring before a specified substring. For example, before("abcdefghij",...
 
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Macro for throwing an exception with breakpointing to ease debugging.
 
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...