Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_StringInputStream.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TEUCHOS_STRINGINPUTSTREAM_H
11 #define TEUCHOS_STRINGINPUTSTREAM_H
12 
17 #include "Teuchos_ConfigDefs.hpp"
19 
20 
21 namespace Teuchos
22 {
23  using std::string;
24 
33  {
34  public:
35 
37  StringInputStream(const std::string& text)
38  : XMLInputStream(), text_(text), pos_(0) {;}
39 
41  virtual ~StringInputStream() {;}
42 
44  virtual unsigned int readBytes(unsigned char* const toFill,
45  const unsigned int maxToRead);
46 
47  private:
48  std::string text_;
49  unsigned int pos_;
50  };
51 
52 }
53 #endif
54 
Instantiation of XMLInputStream for reading an entire document from a std::string.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
A base class for defining a XML input stream.
XMLInputStream represents an XML input stream that can be used by a XMLInputSource.
StringInputStream(const std::string &text)
Construct with the std::string from which data will be read.
virtual ~StringInputStream()
Destructor.
virtual unsigned int readBytes(unsigned char *const toFill, const unsigned int maxToRead)
Read up to maxToRead bytes.