Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_FileInputStream.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_FILEINPUTSTREAM_H
11 #define TEUCHOS_FILEINPUTSTREAM_H
12 
17 #include "Teuchos_ConfigDefs.hpp"
19 
20 namespace Teuchos
21 {
22  using std::string;
23 
30  {
31  public:
33  FileInputStream(const std::string& filename);
34 
36  virtual ~FileInputStream() { if( file_ ) { std::fclose(file_); } }
37 
39  virtual unsigned int readBytes(unsigned char* const toFill,
40  const unsigned int maxToRead);
41 
42  private:
43  std::FILE* file_;
44  };
45 }
46 #endif
47 
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.
FileInputStream(const std::string &filename)
Construct with a filename.
virtual unsigned int readBytes(unsigned char *const toFill, const unsigned int maxToRead)
Read up to maxToRead bytes.
virtual ~FileInputStream()
Destructor.
Instantiation of XMLInputStream class for reading an entire document from a file. ...