Rosetta
Namespaces | Classes | Typedefs | Functions | Variables
utility::io Namespace Reference

Namespaces

 ic
 
 mpi_stream
 
 oc
 

Classes

class  FileContentsMap
 The FileContentsMap is a class that will minimize the number of times files are accessed from disk. The first time the contents of a file are requested, it will cache the contents the file in memory as a strings. All subsequent requests for the contents of that file will then be delivered without having to go to disk. WARNING: The FileContentsMap will not update the contents that it holds for a file after the first time it loads it, so if the contents change on disk, the FileContentsMap will be out of date. More...
 
class  GeneralFileContents
 
class  GeneralFileManager
 
class  GeneralFileContentsVector
 
class  GeneralFileManagerVector
 
class  icstream
 icstream: Input channel stream wrapper class More...
 
class  irstream
 orstream: Input stream wrapper abstract base class More...
 
class  izstream
 izstream: Input file stream wrapper for uncompressed and compressed files More...
 
class  ocstream
 ocstream: Output channel stream wrapper class More...
 
class  orstream
 orstream: Output stream wrapper base class More...
 
class  ozstream
 ozstream: Output file stream wrapper for uncompressed and compressed files More...
 

Typedefs

typedef utility::pointer::shared_ptr< FileContentsMapFileContentsMapOP
 
typedef utility::pointer::shared_ptr< FileContentsMap const > FileContentsMapCOP
 
typedef utility::pointer::shared_ptr< GeneralFileManagerGeneralFileManagerOP
 
typedef utility::pointer::shared_ptr< GeneralFileManager const > GeneralFileManagerCOP
 
typedef utility::pointer::shared_ptr< GeneralFileContentsGeneralFileContentsOP
 
typedef utility::pointer::shared_ptr< GeneralFileContents const > GeneralFileContentsCOP
 
typedef utility::pointer::shared_ptr< GeneralFileManagerVectorGeneralFileManagerVectorOP
 
typedef utility::pointer::shared_ptr< GeneralFileManagerVector const > GeneralFileManagerVectorCOP
 
typedef utility::pointer::shared_ptr< GeneralFileContentsVectorGeneralFileContentsVectorOP
 
typedef utility::pointer::shared_ptr< GeneralFileContentsVector const > GeneralFileContentsVectorCOP
 

Functions

static bool is_base64 (unsigned char c)
 
std::string base64_encode (unsigned char const *bytes_to_encode, unsigned int in_len)
 
std::string base64_decode (std::string const &encoded_string)
 
izstreamgetline (izstream &stream, std::string &line)
 std::getline( std::istream, std::string ) wrapper More...
 
izstreamgetline (izstream &stream, std::string &line, char const delim)
 std::getline( std::istream, std::string, char ) wrapper More...
 
std::istream & skip (izstream &stream)
 Skip rest of line and line terminator (manipulator) More...
 
std::istream & skip (std::istream &stream)
 Skip rest of line and line terminator (manipulator) More...
 
utility::vector1< std::string > get_lines_from_file_data (std::string const &filename)
 General method that opens a file and returns its data as a list of lines after checking for errors. More...
 
void remove_inline_comments (std::string &line)
 General method for removing comments from a line read from a database file. More...
 
template<class T >
void read_vector (std::istream &is, vector1< T > &vec)
 
template<class T >
void write_vector (std::ostream &out, vector1< T > const &vec)
 
template<class T >
void write_vector (std::string filename, vector1< T > const &vec)
 

Variables

static const std::string base64_chars
 
std::streamsize const OZSTREAM_DEFAULT_BUFFER_SIZE = 921600
 default buffer size for ozstreams (900KB) More...
 

Typedef Documentation

◆ FileContentsMapCOP

typedef utility::pointer::shared_ptr< FileContentsMap const > utility::io::FileContentsMapCOP

◆ FileContentsMapOP

typedef utility::pointer::shared_ptr< FileContentsMap > utility::io::FileContentsMapOP

◆ GeneralFileContentsCOP

typedef utility::pointer::shared_ptr< GeneralFileContents const > utility::io::GeneralFileContentsCOP

◆ GeneralFileContentsOP

typedef utility::pointer::shared_ptr< GeneralFileContents > utility::io::GeneralFileContentsOP

◆ GeneralFileContentsVectorCOP

typedef utility::pointer::shared_ptr< GeneralFileContentsVector const > utility::io::GeneralFileContentsVectorCOP

◆ GeneralFileContentsVectorOP

◆ GeneralFileManagerCOP

typedef utility::pointer::shared_ptr< GeneralFileManager const > utility::io::GeneralFileManagerCOP

◆ GeneralFileManagerOP

typedef utility::pointer::shared_ptr< GeneralFileManager > utility::io::GeneralFileManagerOP

◆ GeneralFileManagerVectorCOP

typedef utility::pointer::shared_ptr< GeneralFileManagerVector const > utility::io::GeneralFileManagerVectorCOP

◆ GeneralFileManagerVectorOP

typedef utility::pointer::shared_ptr< GeneralFileManagerVector > utility::io::GeneralFileManagerVectorOP

Function Documentation

◆ base64_decode()

std::string utility::io::base64_decode ( std::string const &  encoded_string)

◆ base64_encode()

std::string utility::io::base64_encode ( unsigned char const *  bytes_to_encode,
unsigned int  in_len 
)

◆ get_lines_from_file_data()

utility::vector1< std::string > utility::io::get_lines_from_file_data ( std::string const &  filename)

General method that opens a file and returns its data as a list of lines after checking for errors.

Blank and commented lines are not returned and the file is closed before returning the lines.

Author
Labonte JWLab.nosp@m.onte.nosp@m.@jhu..nosp@m.edu

References data, file_exists(), utility::filename(), getline(), line, solution_counts::lines, utility::trim(), and utility_exit_with_message.

Referenced by main().

◆ getline() [1/2]

izstream& utility::io::getline ( izstream stream,
std::string &  line 
)
inline

std::getline( std::istream, std::string ) wrapper

References getline(), and line.

Referenced by get_lines_from_file_data(), and main().

◆ getline() [2/2]

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

std::getline( std::istream, std::string, char ) wrapper

References getline(), and line.

◆ is_base64()

static bool utility::io::is_base64 ( unsigned char  c)
inlinestatic

◆ read_vector()

template<class T >
void utility::io::read_vector ( std::istream &  is,
vector1< T > &  vec 
)

◆ remove_inline_comments()

void utility::io::remove_inline_comments ( std::string &  line)

General method for removing comments from a line read from a database file.

Inline comments (indicated with #) are trimmed from the end of a passed string.

Author
Labonte JWLab.nosp@m.onte.nosp@m.@jhu..nosp@m.edu

References line.

◆ skip() [1/2]

std::istream& utility::io::skip ( izstream stream)
inline

Skip rest of line and line terminator (manipulator)

References utility::io::izstream::ignore(), and max().

Referenced by load_checkpoint().

◆ skip() [2/2]

std::istream& utility::io::skip ( std::istream &  stream)
inline

Skip rest of line and line terminator (manipulator)

References max().

◆ write_vector() [1/2]

template<class T >
void utility::io::write_vector ( std::ostream &  out,
vector1< T > const &  vec 
)

References vec().

Referenced by write_vector().

◆ write_vector() [2/2]

template<class T >
void utility::io::write_vector ( std::string  filename,
vector1< T > const &  vec 
)

Variable Documentation

◆ base64_chars

const std::string utility::io::base64_chars
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"

Referenced by base64_decode(), and base64_encode().

◆ OZSTREAM_DEFAULT_BUFFER_SIZE

std::streamsize const utility::io::OZSTREAM_DEFAULT_BUFFER_SIZE = 921600

default buffer size for ozstreams (900KB)

Note
this must be at least 4KB, otherwise zipstream will break