ModErn Text Analysis
META Enumerates Textual Applications
Namespaces | Classes | Typedefs | Functions
meta::io Namespace Reference

Compressed file readers and writers, configuration file readers, a simple parser, and memory-mapped file support. More...

Namespaces

 libsvm_parser
 Parser specifically for libsvm-formatted files.
 

Classes

class  gzifstream
 
class  gzofstream
 
class  gzstreambuf
 
class  mfstream
 A stupid wrapper around a std::fstream to work around GCC's libstdc++ lacking move constructors for std::fstream until GCC 5. More...
 
class  mmap_file
 Memory maps a text file readonly. More...
 
class  mmap_file_exception
 Basic exception for mmap_file interactions. More...
 
class  mmap_ifstream
 A stream for use with io::packed that reads from a memory mapped file. More...
 

Typedefs

using mifstream = mfstream< std::ifstream >
 
using mofstream = mfstream< std::ofstream >
 

Functions

template<class T >
uint64_t write_binary (std::ostream &out, const T &elem)
 Writes an object in binary format to a stream. More...
 
uint64_t write_binary (std::ostream &out, const std::string &str)
 Writes a std::string object in binary format to a stream. More...
 
template<class T >
void read_binary (std::istream &in, T &elem)
 Reads an object in binary from a stream. More...
 
void read_binary (std::istream &in, std::string &str)
 Reads a string in binary from a stream. More...
 

Detailed Description

Compressed file readers and writers, configuration file readers, a simple parser, and memory-mapped file support.

Function Documentation

§ write_binary() [1/2]

template<class T >
uint64_t meta::io::write_binary ( std::ostream &  out,
const T &  elem 
)

Writes an object in binary format to a stream.

Parameters
outThe stream to write to
elemThe element to write

§ write_binary() [2/2]

uint64_t meta::io::write_binary ( std::ostream &  out,
const std::string &  str 
)
inline

Writes a std::string object in binary format to a stream.

Parameters
outThe stream to write to
strthe string to write

§ read_binary() [1/2]

template<class T >
void meta::io::read_binary ( std::istream &  in,
T &  elem 
)

Reads an object in binary from a stream.

Parameters
inThe stream to read from
elemThe element to read

§ read_binary() [2/2]

void meta::io::read_binary ( std::istream &  in,
std::string &  str 
)
inline

Reads a string in binary from a stream.

Parameters
inThe stream to read from
strThe string to read