Rosetta 3.3
Public Member Functions | Friends
utility::io::izstream Class Reference

izstream: Input file stream wrapper for uncompressed and compressed files More...

#include <izstream.hh>

Inheritance diagram for utility::io::izstream:
Inheritance graph
[legend]
Collaboration diagram for utility::io::izstream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 izstream ()
 Default constructor.
 izstream (std::string const &filename_a, std::ios_base::openmode open_mode=std::ios_base::in)
 Filename constructor.
virtual ~izstream ()
 Destructor.
 operator bool () const
 bool conversion
 operator std::istream const & () const
 Stream conversion.
 operator std::istream & ()
 Stream conversion.
template<typename T >
std::istream & operator>> (T &t)
 Stream input.
std::istream & operator>> (manipulator m)
 Stream manipulator input.
std::istream & operator>> (std_manipulator m)
 Stream manipulator input.
void open (std::string const &filename_a, std::ios_base::openmode open_mode=std::ios_base::in)
 Open a file.
void clear ()
 Clear the stream(s)
void close ()
 Close the ifstream and reset the state.
void seek_beg ()
 Seek to the beginning.
int get ()
 Get the next character.
izstreamget (char &c)
 Get the next character.
izstreamget (char *str, std::streamsize const count)
 Get the next specified number of characters.
izstreamget (char *str, std::streamsize const count, char const delim)
 Get the next specified number of characters.
izstreamget (std::string &str, std::streamsize const count)
 Get the next specified number of characters.
izstreamget (std::string &str, std::streamsize const count, char const delim)
 Get the next specified number of characters.
izstreamgetline (char *line, std::streamsize const count)
 Get the rest of the line.
izstreamgetline (char *line, std::streamsize const count, char const delim)
 Get the rest of the line.
izstreamgetline (std::string &line)
 Get the rest of the line.
izstreamgetline (std::string &line, char const delim)
 Get the rest of the line.
izstreamread (char *str, std::streamsize const count)
 Read the next specified number of characters.
izstreamread (std::string &str, std::streamsize const count)
 Read the next specified number of characters.
std::streamsize readsome (char *str, std::streamsize const count)
 Read the next available specified number of characters.
std::streamsize readsome (std::string &str, std::streamsize const count)
 Read the next available specified number of characters.
izstreamignore ()
 Skip over the next character.
izstreamignore (std::streamsize const count)
 Skip over the next specified number of characters.
izstreamignore (std::streamsize const count, char const delim)
 Skip over the next specified number of characters.
int peek ()
 Returns the next character without extracting it.
izstreamunget ()
 Put the last character read back into the stream.
izstreamputback (char c)
 Put the last character read back into the stream and check that passed character is correct.
std::istream const & operator() () const
 Stream access.
std::istream & operator() ()
 Stream access.
std::istream const & stream () const
 Stream access.
std::istream & stream ()
 Stream access.
std::streambuf * rdbuf () const
 Pointer to the stream buffer.
std::string const & filename () const
 File name.
std::streamsize gcount () const
 Get the number of characters read by the last unformatted read.
bool good () const
 Good?
bool eof () const
 End of file?
bool fail () const
 Fail?
bool bad () const
 Bad?
bool compressed () const
 Compressed?
bool uncompressed () const
 Uncompressed?
bool gzipped () const
 gzipped?

Friends

long utility::file::gzip (std::string const &uncompressedfile, bool overwrite)
long utility::file::gunzip (std::string const &compressedfile, bool overwrite)

Detailed Description

izstream: Input file stream wrapper for uncompressed and compressed files


Constructor & Destructor Documentation

utility::io::izstream::izstream ( ) [inline]

Default constructor.

utility::io::izstream::izstream ( std::string const &  filename_a,
std::ios_base::openmode  open_mode = std::ios_base::in 
) [inline, explicit]

Filename constructor.

References open().

virtual utility::io::izstream::~izstream ( ) [inline, virtual]

Destructor.


Member Function Documentation

bool utility::io::izstream::bad ( ) const [inline, virtual]

Bad?

Implements utility::io::irstream.

References stream().

void utility::io::izstream::clear ( ) [inline, virtual]

Clear the stream(s)

Implements utility::io::irstream.

Referenced by basic::database::open(), and utility::PeriodicSplineReader::read().

void utility::io::izstream::close ( ) [inline]
bool utility::io::izstream::compressed ( ) const [inline, virtual]

Compressed?

Implements utility::io::irstream.

bool utility::io::izstream::eof ( ) const [inline, virtual]

End of file?

Implements utility::io::irstream.

References stream().

Referenced by utility::PeriodicSplineReader::read().

bool utility::io::izstream::fail ( ) const [inline, virtual]
std::string const& utility::io::izstream::filename ( ) const [inline]

File name.

Referenced by basic::database::open().

std::streamsize utility::io::izstream::gcount ( ) const [inline]

Get the number of characters read by the last unformatted read.

References stream().

izstream& utility::io::izstream::get ( std::string &  str,
std::streamsize const  count,
char const  delim 
) [inline, virtual]

Get the next specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

int utility::io::izstream::get ( ) [inline, virtual]

Get the next character.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::get ( char &  c) [inline, virtual]

Get the next character.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::get ( char *  str,
std::streamsize const  count 
) [inline, virtual]

Get the next specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

izstream& utility::io::izstream::get ( char *  str,
std::streamsize const  count,
char const  delim 
) [inline, virtual]

Get the next specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

izstream& utility::io::izstream::get ( std::string &  str,
std::streamsize const  count 
) [inline, virtual]

Get the next specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

izstream& utility::io::izstream::getline ( char *  line,
std::streamsize const  count 
) [inline, virtual]

Get the rest of the line.

Implements utility::io::irstream.

References stream().

Referenced by getline(), and basic::options::start_files().

izstream& utility::io::izstream::getline ( char *  line,
std::streamsize const  count,
char const  delim 
) [inline, virtual]

Get the rest of the line.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::getline ( std::string &  line) [inline, virtual]

Get the rest of the line.

Implements utility::io::irstream.

References getline(), and stream().

izstream& utility::io::izstream::getline ( std::string &  line,
char const  delim 
) [inline, virtual]

Get the rest of the line.

Implements utility::io::irstream.

References getline(), and stream().

bool utility::io::izstream::good ( ) const [inline, virtual]

Good?

Implements utility::io::irstream.

References stream().

Referenced by basic::database::open(), and basic::options::start_files().

bool utility::io::izstream::gzipped ( ) const [inline, virtual]

gzipped?

Implements utility::io::irstream.

izstream& utility::io::izstream::ignore ( ) [inline, virtual]

Skip over the next character.

Implements utility::io::irstream.

References stream().

Referenced by utility::io::skip().

izstream& utility::io::izstream::ignore ( std::streamsize const  count) [inline, virtual]

Skip over the next specified number of characters.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::ignore ( std::streamsize const  count,
char const  delim 
) [inline, virtual]

Skip over the next specified number of characters.

Implements utility::io::irstream.

References stream().

void utility::io::izstream::open ( std::string const &  filename_a,
std::ios_base::openmode  open_mode = std::ios_base::in 
)
utility::io::izstream::operator bool ( ) const [inline, virtual]

bool conversion

Implements utility::io::irstream.

utility::io::izstream::operator std::istream & ( ) [inline, virtual]

Stream conversion.

Implements utility::io::irstream.

utility::io::izstream::operator std::istream const & ( ) const [inline, virtual]

Stream conversion.

Implements utility::io::irstream.

std::istream& utility::io::izstream::operator() ( ) [inline, virtual]

Stream access.

Implements utility::io::irstream.

std::istream const& utility::io::izstream::operator() ( ) const [inline, virtual]

Stream access.

Implements utility::io::irstream.

template<typename T >
std::istream& utility::io::izstream::operator>> ( T &  t) [inline]

Stream input.

Reimplemented from utility::io::irstream.

References stream(), and sd::t.

std::istream& utility::io::izstream::operator>> ( manipulator  m) [inline]

Stream manipulator input.

std::istream& utility::io::izstream::operator>> ( std_manipulator  m) [inline, virtual]

Stream manipulator input.

Implements utility::io::irstream.

int utility::io::izstream::peek ( ) [inline, virtual]

Returns the next character without extracting it.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::putback ( char  c) [inline, virtual]

Put the last character read back into the stream and check that passed character is correct.

Implements utility::io::irstream.

References stream().

std::streambuf* utility::io::izstream::rdbuf ( ) const [inline, virtual]

Pointer to the stream buffer.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::read ( char *  str,
std::streamsize const  count 
) [inline, virtual]

Read the next specified number of characters.

Implements utility::io::irstream.

References stream().

izstream& utility::io::izstream::read ( std::string &  str,
std::streamsize const  count 
) [inline, virtual]

Read the next specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

std::streamsize utility::io::izstream::readsome ( char *  str,
std::streamsize const  count 
) [inline, virtual]

Read the next available specified number of characters.

Implements utility::io::irstream.

References stream().

std::streamsize utility::io::izstream::readsome ( std::string &  str,
std::streamsize const  count 
) [inline, virtual]

Read the next available specified number of characters.

Implements utility::io::irstream.

References get_pdb::count, and stream().

void utility::io::izstream::seek_beg ( ) [inline, virtual]
std::istream const& utility::io::izstream::stream ( ) const [inline, virtual]
std::istream& utility::io::izstream::stream ( ) [inline, virtual]

Stream access.

Implements utility::io::irstream.

bool utility::io::izstream::uncompressed ( ) const [inline, virtual]

Uncompressed?

Implements utility::io::irstream.

izstream& utility::io::izstream::unget ( ) [inline, virtual]

Put the last character read back into the stream.

Implements utility::io::irstream.

References stream().


Friends And Related Function Documentation

long utility::file::gunzip ( std::string const &  compressedfile,
bool  overwrite 
) [friend]
long utility::file::gzip ( std::string const &  uncompressedfile,
bool  overwrite 
) [friend]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines