ModErn Text Analysis
META Enumerates Textual Applications
Namespaces | Classes | Enumerations | 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  compressed_file_reader
 Represents a file of unsigned integers compressed using gamma compression. More...
 
class  compressed_file_writer
 Writes to a file of unsigned integers using gamma compression. More...
 
class  gzifstream
 
class  gzofstream
 
class  gzstreambuf
 
class  mmap_file
 Memory maps a text file readonly. More...
 
class  parser
 Parses a text file by reading it completely into memory, delimiting tokens by user request. More...
 

Enumerations

enum  ReaderStatus { notDone, readerDone, userDone }
 Simply saves the current state of the reader.
 

Functions

template<class T >
void write_binary (std::ostream &out, const T &elem)
 Writes an object in binary format to a stream. More...
 
void 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...
 
uint64_t default_compression_reader_func (uint64_t value)
 Function that converts a compressed number back into its normal representation. More...
 
uint64_t default_compression_writer_func (uint64_t key)
 Shows how to convert a number into its compressed form. More...
 

Detailed Description

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

Function Documentation

template<class T >
void 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
void 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
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
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
uint64_t meta::io::default_compression_reader_func ( uint64_t  value)

Function that converts a compressed number back into its normal representation.

Parameters
valueThe value to transform
Returns
the original form
uint64_t meta::io::default_compression_writer_func ( uint64_t  key)

Shows how to convert a number into its compressed form.

Parameters
keyThe value to transform
Returns
the compressed form