This file is indexed.

/usr/include/trilinos/Teuchos_StrUtils.hpp is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// @HEADER
// ***********************************************************************
// 
//                    Teuchos: Common Tools Package
//                 Copyright (2004) Sandia Corporation
// 
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
// 
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//  
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//  
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
// Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
// 
// ***********************************************************************
// @HEADER

#ifndef TEUCHOS_STRUTILS_H
#define TEUCHOS_STRUTILS_H

/*! \file Teuchos_StrUtils.hpp
    \brief A std::string utilities class for Teuchos
*/

#include "Teuchos_ConfigDefs.hpp"

#include "Teuchos_Utils.hpp"
#include "Teuchos_Array.hpp"

namespace Teuchos
{
  /** 
   * \brief Provides std::string manipulation utilities that are not provided in the
   * standard C++ std::string class.
   */
  class TEUCHOS_LIB_DLL_EXPORT StrUtils
    {
    public:
      /** \brief Read a file, putting each line into a std::string */
      static Array<std::string> readFile(std::istream& is, char comment);

      /** \brief Split an input std::string that contains newlines into an array
 	 of strings, one for each line */
      static Array<std::string> splitIntoLines(const std::string& input);

      /** \brief Tokenize a file into whitespace-delimited tokens */
      static Array<Array<std::string> > tokenizeFile(std::istream& is, char comment);

      /** \brief Read a single line into a std::string */
      static bool readLine(std::istream& is, std::string& line);

      static Array<std::string> stringTokenizer(const std::string& str);

      static Array<std::string> getTokensPlusWhitespace(const std::string& str);

      static std::string reassembleFromTokens(const Array<std::string>& tokens, int iStart=0);

      static void splitList(const std::string& bigstring, Array<std::string>& elements);

      static int findNextWhitespace(const std::string& str, int offset);

      static int findNextNonWhitespace(const std::string& str, int offset);


      static  std::string varSubstitute(const std::string& rawLine,
                                   const std::string& varName,
                                   const std::string& varValue);

      static std::string varTableSubstitute(const std::string& rawLine,
                                       const Array<std::string>& varNames,
                                       const Array<std::string>& varValues);

      static std::string envSubstitute(const std::string& line);

      /** \brief Find the substring before a specified substring. For example,
       * before("abcdefghij", "gh") returns "abcdef". */
      static std::string before(const std::string& str, const std::string& sub);

      /** \brief Find the substring before a specified character. For example,
       * before("abcdefghij", 'g') returns "abcdef". */
      static std::string before(const std::string& str, char sub);

      /** \brief Find the substring after a specified substring. For example,
       * before("abcdefghij", "gh") returns "ij". */
      static std::string after(const std::string& str, const std::string& sub);

      /** \brief Find the position at which a substring first occurs. For example,
       * find("abcdefghij", "gh") returns 6. */
      static int find(const std::string& str, const std::string& sub);

      /** \brief Returns true if a std::string consists entirely of whitespace */
      static bool isWhite(const std::string& str);

      /** \brief Convert unprintable non-null characters to whitespace */
      static std::string fixUnprintableCharacters(const std::string& str);

      /** \brief Returns true if a std::string has any non-whitespace */
      static bool isNonWhite(const std::string& str) {return !isWhite(str);}

      /** \brief Returns the std::string between two delimiting strings, and returns
       * by reference the strings before and after the delimiters.
       *
       * For example, between("abcdefghij", "c", "g", front, back)
       * returns "def" and sets front to "ab", back to "hij". */
      static std::string between(const std::string& str, const std::string& begin,
                            const std::string& end, std::string& front, std::string& back);

      /** \brief Returns the substring between two positions. 
       *
       *  For example, subString("abcdefghij", 2, 5) returns "cde". */
      static std::string subString(const std::string& str, int begin, int end);

      static std::string readFromStream(std::istream& is);

      /** \brief Converts a std::string to all upper case */
      static std::string allCaps(const std::string& str);

      /** \brief Returns the double value of a std::string. */
      static double atof(const std::string& str);

      /** \brief Returns the int value of a std::string. */
      static int atoi(const std::string& str);

      /** \brief Print lines with prefix first. */
      static std::ostream& printLines(
        std::ostream             &os
        ,const std::string       &linePrefix
        ,const std::string       &lines
        );

    };

}

#endif