libDwm-0.6.0
Dwm::IO Class Reference

This class contains a collection of static functions for reading and writing simple types, in network byte order (MSB first). More...

#include <DwmIO.hh>

Static Public Member Functions

static uint32_t StreamedLength (char c)
 Returns the number of bytes that would be written if we called Write() for a char. More...
 
static std::ostream & Write (std::ostream &os, char c)
 Writes c to os. Returns os.
 
static uint32_t StreamedLength (uint8_t c)
 Returns the number of bytes that would be written if we called Write() for a uint8_t. More...
 
static std::ostream & Write (std::ostream &os, uint8_t c)
 Writes c to os. Returns os.
 
static uint32_t StreamedLength (bool b)
 Returns the number of bytes that would be written if we called one of the Write() members for a bool. More...
 
static std::ostream & Write (std::ostream &os, bool b)
 Writes a bool b to an ostream os. Returns os.
 
static uint32_t StreamedLength (int16_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for an int16_t. More...
 
static std::ostream & Write (std::ostream &os, int16_t val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (uint16_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for a uint16_t. More...
 
static std::ostream & Write (std::ostream &os, uint16_t val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (int32_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for an int32_t. More...
 
static std::ostream & Write (std::ostream &os, int32_t val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (uint32_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for a uint32_t. More...
 
static std::ostream & Write (std::ostream &os, uint32_t val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (int64_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for an int64_t. More...
 
static std::ostream & Write (std::ostream &os, const int64_t &val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (uint64_t val)
 Returns the number of bytes that would be written if we called one of the Write() members for a uint64_t. More...
 
static std::ostream & Write (std::ostream &os, const uint64_t &val)
 Writes val to os, in network byte order (MSB first). More...
 
static uint32_t StreamedLength (float val)
 Returns the number of bytes that should be written if we call one of the Write() members for a float. More...
 
static std::ostream & Write (std::ostream &os, float val)
 Writes val to os, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static uint32_t StreamedLength (double val)
 Returns the number of bytes that should be written if we call one of the Write() members for a double. More...
 
static std::ostream & Write (std::ostream &os, const double &val)
 Writes val to os, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static uint32_t StreamedLength (const std::string &s)
 Returns the number of bytes that should be written if we call one of the Write() members for a string. More...
 
static std::ostream & Write (std::ostream &os, const std::string &s)
 Writes s to os. More...
 
static std::istream & Read (std::istream &is, char &c)
 Reads c from is. Returns is.
 
static std::istream & Read (std::istream &is, uint8_t &c)
 Reads c from is. Returns is.
 
static std::istream & Read (std::istream &is, bool &b)
 Reads b from is. Returns is.
 
static std::istream & Read (std::istream &is, int16_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, uint16_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, int32_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, uint32_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, int64_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, uint64_t &val)
 Reads val from is, in network byte order (MSB first). More...
 
static std::istream & Read (std::istream &is, float &val)
 Reads val from is, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static std::istream & Read (std::istream &is, double &val)
 Reads val from is, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static std::istream & Read (std::istream &is, std::string &s)
 Reads string s from is. More...
 
static ssize_t Write (int fd, char c)
 Writes c to fd. More...
 
static ssize_t Write (int fd, uint8_t c)
 Writes c to fd. More...
 
static ssize_t Write (int fd, bool b)
 Writes b to fd. More...
 
static ssize_t Write (int fd, int16_t val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, uint16_t val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, int32_t val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, uint32_t val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, const int64_t &val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, const uint64_t &val)
 Writes val to fd, in network byte order (MSB first). More...
 
static ssize_t Write (int fd, float val)
 Writes val to fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static ssize_t Write (int fd, const double &val)
 Writes val to fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static ssize_t Write (int fd, const std::string &s)
 Writes s to fd. More...
 
static ssize_t Read (int fd, char &c)
 Reads c from fd. More...
 
static ssize_t Read (int fd, uint8_t &c)
 Reads c from fd. More...
 
static ssize_t Read (int fd, bool &b)
 Reads b from fd. More...
 
static ssize_t Read (int fd, int16_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, uint16_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, int32_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, uint32_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, int64_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, uint64_t &val)
 Reads val from fd, in network byte order (MSB first). More...
 
static ssize_t Read (int fd, float &val)
 Reads val from fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static ssize_t Read (int fd, double &val)
 Reads val from fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static ssize_t Read (int fd, std::string &s)
 Reads s from fd. More...
 
static size_t Write (FILE *f, char c)
 Writes c to f. More...
 
static size_t Write (FILE *f, uint8_t c)
 Writes c to f. More...
 
static size_t Write (FILE *f, bool b)
 Writes b to f. More...
 
static size_t Write (FILE *f, int16_t val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, uint16_t val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, int32_t val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, uint32_t val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, const int64_t &val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, const uint64_t &val)
 Writes val to f, in network byte order (MSB first). More...
 
static size_t Write (FILE *f, float val)
 Writes val to f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static size_t Write (FILE *f, const double &val)
 Writes val to f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static size_t Write (FILE *f, const std::string &s)
 Writes s to f. More...
 
static size_t Read (FILE *f, char &c)
 Reads c from f. More...
 
static size_t Read (FILE *f, uint8_t &c)
 Reads c from f. More...
 
static size_t Read (FILE *f, bool &b)
 Reads b from f. More...
 
static size_t Read (FILE *f, int16_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, uint16_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, int32_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, uint32_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, int64_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, uint64_t &val)
 Reads val from f, in network byte order (MSB first). More...
 
static size_t Read (FILE *f, float &val)
 Reads val from f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static size_t Read (FILE *f, double &val)
 Reads val from f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). More...
 
static size_t Read (FILE *f, std::string &s)
 Reads s from f. More...
 
static uint32_t StreamedLength (const Writable &val)
 Returns the number of bytes that should be written if we call one of the Write() members for a Writable val. More...
 
static std::ostream & Write (std::ostream &os, const Writable &val)
 Wrapper function to write a Writable object to an ostream.
 
static ssize_t Write (int fd, const Writable &val)
 Wrapper function to write a Writable object to a descriptor.
 
static size_t Write (FILE *f, const Writable &val)
 Wrapper function to write a Writable object to a FILE pointer.
 
static std::istream & Read (std::istream &is, Readable &val)
 Wrapper function to read a Readable object from an istream.
 
static ssize_t Read (int fd, Readable &val)
 Wrapper function to read a Readable object from a descriptor.
 
static size_t Read (FILE *f, Readable &val)
 Wrapper function to read a Readable object from a FILE pointer.
 
template<typename _firstT , typename _secondT >
static uint32_t StreamedLength (const std::pair< _firstT, _secondT > &p)
 Returns the number of bytes that should be written if we call one of the Write() members for a pair<_firstT, _secondT>
 
template<typename _firstT , typename _secondT >
static std::istream & Read (std::istream &is, std::pair< _firstT, _secondT > &p)
 Reads a pair<_firstT,_secondT> from an istream. Returns the istream.
 
template<typename _firstT , typename _secondT >
static std::ostream & Write (std::ostream &os, const std::pair< _firstT, _secondT > &p)
 Writes a pair<_firstT,_secondT> to an ostream. Returns the ostream.
 
template<typename _firstT , typename _secondT >
static size_t Read (FILE *f, std::pair< _firstT, _secondT > &p)
 Reads a pair<_firstT,_secondT> from a FILE pointer. More...
 
template<typename _firstT , typename _secondT >
static size_t Write (FILE *f, const std::pair< _firstT, _secondT > &p)
 Writes a pair<_firstT,_secondT> to a FILE pointer. More...
 
template<typename _firstT , typename _secondT >
static ssize_t Read (int fd, std::pair< _firstT, _secondT > &p)
 Reads a pair<_firstT,_secondT> from a file descriptor. More...
 
template<typename _firstT , typename _secondT >
static ssize_t Write (int fd, const std::pair< _firstT, _secondT > &p)
 Writes a pair<_firstT,_secondT> to a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static uint32_t StreamedLength (const std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Returns the number of bytes that should be written if we call one of the Write() members for a map<_keyT, _valueT>
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static std::istream & Read (std::istream &is, std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a map<_keyT,_valueT> from an istream. Returns the istream.
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a map<_keyT,_valueT> to an ostream. Returns the ostream.
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Read (FILE *f, std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a map<_keyT,_valueT> from a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Write (FILE *f, const std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a map<_keyT,_valueT> to a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Read (int fd, std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a map<_keyT,_valueT> from a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Write (int fd, const std::map< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a map<_keyT,_valueT> to a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static uint32_t StreamedLength (const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Returns the number of bytes that should be written if we call one of the Write() members for a multimap<_keyT, _valueT>
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static std::istream & Read (std::istream &is, std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a multimap<_keyT,_valueT> from an istream. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a multimap<_keyT,_valueT> to an ostream. Returns the ostream.
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Read (FILE *f, std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a multimap<_keyT,_valueT> from a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Write (FILE *f, const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a multimap<_keyT,_valueT> to a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Read (int fd, std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Reads a multimap<_keyT,_valueT> from a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Write (int fd, const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m)
 Writes a multimap<_keyT,_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static uint32_t StreamedLength (const std::vector< _valueT, _Alloc > &v)
 Returns the number of bytes that should be written if we call one of the Write() members for a vector<_valueT>
 
template<typename _valueT , typename _Alloc >
static std::istream & Read (std::istream &is, std::vector< _valueT, _Alloc > &v)
 Reads a vector<_valueT> from an istream. Returns the istream.
 
template<typename _valueT , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::vector< _valueT, _Alloc > &v)
 Writes a vector<_valueT> to an ostream. Returns the ostream.
 
template<typename _valueT , typename _Alloc >
static size_t Read (FILE *f, std::vector< _valueT, _Alloc > &v)
 Reads a vector<_valueT> from a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static size_t Write (FILE *f, const std::vector< _valueT, _Alloc > &v)
 Writes a vector<_valueT> to a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Read (int fd, std::vector< _valueT, _Alloc > &v)
 Reads a vector<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Write (int fd, const std::vector< _valueT, _Alloc > &v)
 Writes a vector<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static uint32_t StreamedLength (const std::deque< _valueT, _Alloc > &d)
 Returns the number of bytes that should be written if we call one of the Write() members for a deque<_valueT>
 
template<typename _valueT , typename _Alloc >
static std::istream & Read (std::istream &is, std::deque< _valueT, _Alloc > &d)
 Reads a deque<_valueT> from an istream. Returns the istream.
 
template<typename _valueT , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::deque< _valueT, _Alloc > &d)
 Writes a deque<_valueT> to an ostream. Returns the ostream.
 
template<typename _valueT , typename _Alloc >
static size_t Read (FILE *f, std::deque< _valueT, _Alloc > &d)
 Reads a deque<_valueT> from a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static size_t Write (FILE *f, const std::deque< _valueT, _Alloc > &d)
 Writes a deque<_valueT> to a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Read (int fd, std::deque< _valueT, _Alloc > &d)
 Reads a deque<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Write (int fd, const std::deque< _valueT, _Alloc > &d)
 Writes a deque<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static uint32_t StreamedLength (const std::list< _valueT, _Alloc > &l)
 Returns the number of bytes that should be written if we call one of the Write() members for a list<_valueT>
 
template<typename _valueT , typename _Alloc >
static std::istream & Read (std::istream &is, std::list< _valueT, _Alloc > &l)
 Reads a list<_valueT> from an istream. Returns the istream.
 
template<typename _valueT , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::list< _valueT, _Alloc > &l)
 Writes a list<_valueT> to an ostream. Returns the ostream.
 
template<typename _valueT , typename _Alloc >
static size_t Read (FILE *f, std::list< _valueT, _Alloc > &l)
 Reads a list<_valueT> from a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static size_t Write (FILE *f, const std::list< _valueT, _Alloc > &l)
 Writes a list<_valueT> to a FILE pointer. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Read (int fd, std::list< _valueT, _Alloc > &l)
 Reads a list<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Alloc >
static ssize_t Write (int fd, const std::list< _valueT, _Alloc > &l)
 Writes a list<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static uint32_t StreamedLength (const std::set< _valueT, _Compare, _Alloc > &l)
 Returns the number of bytes that should be written if we call one of the Write() members for a set<_valueT>
 
template<typename _valueT , typename _Compare , typename _Alloc >
static std::istream & Read (std::istream &is, std::set< _valueT, _Compare, _Alloc > &l)
 Reads a set<_valueT> from an istream. Returns the istream.
 
template<typename _valueT , typename _Compare , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::set< _valueT, _Compare, _Alloc > &l)
 Writes a set<_valueT> to an ostream. Returns the ostream.
 
template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Read (FILE *f, std::set< _valueT, _Compare, _Alloc > &l)
 Reads a set<_valueT> from a FILE pointer. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Write (FILE *f, const std::set< _valueT, _Compare, _Alloc > &l)
 Writes a set<_valueT> to a FILE pointer. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Read (int fd, std::set< _valueT, _Compare, _Alloc > &l)
 Reads a set<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Write (int fd, const std::set< _valueT, _Compare, _Alloc > &l)
 Writes a set<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static uint32_t StreamedLength (const std::multiset< _valueT, _Compare, _Alloc > &l)
 Returns the number of bytes that should be written if we call one of the Write() members for a multiset<_valueT>
 
template<typename _valueT , typename _Compare , typename _Alloc >
static std::istream & Read (std::istream &is, std::multiset< _valueT, _Compare, _Alloc > &l)
 Reads a multiset<_valueT> from an istream. Returns the istream.
 
template<typename _valueT , typename _Compare , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::multiset< _valueT, _Compare, _Alloc > &l)
 Writes a multiset<_valueT> to an ostream. Returns the ostream.
 
template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Read (FILE *f, std::multiset< _valueT, _Compare, _Alloc > &l)
 Reads a multiset<_valueT> from a FILE pointer. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Write (FILE *f, const std::multiset< _valueT, _Compare, _Alloc > &l)
 Writes a multiset<_valueT> to a FILE pointer. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Read (int fd, std::multiset< _valueT, _Compare, _Alloc > &l)
 Reads a multiset<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Write (int fd, const std::multiset< _valueT, _Compare, _Alloc > &l)
 Writes a multiset<_valueT> to a file descriptor. More...
 
template<typename T , typename... Args>
static uint32_t VarStreamedLength (const T &t, Args... args)
 
template<typename T , typename... Args>
static std::ostream & VarWrite (std::ostream &os, const T &t, Args... args)
 
template<typename T , typename... Args>
static std::istream & VarRead (std::istream &is, const T &t, Args... args)
 
template<typename T , typename... Args>
static uint32_t StreamedLength (const std::tuple< T, Args... > &t)
 Returns the number of bytes that should be written if we call one of the Write() members for a tuple. More...
 
template<typename T , typename... Args>
static std::istream & Read (std::istream &is, std::tuple< T, Args... > &t)
 Reads a tuple from an istream. Returns the istream.
 
template<typename T , typename... Args>
static std::ostream & Write (std::ostream &os, const std::tuple< T, Args... > &t)
 Writes a tuple to an ostream. Returns the ostream.
 
template<typename T , typename... Args>
static ssize_t Read (int fd, std::tuple< T, Args... > &t)
 Reads a tuple from a file descriptor. More...
 
template<typename T , typename... Args>
static ssize_t Write (int fd, const std::tuple< T, Args... > &t)
 Writes a tuple to a file descriptor. More...
 
template<typename T , typename... Args>
static size_t Read (FILE *f, std::tuple< T, Args... > &t)
 Reads a tuple from a FILE. Returns 1 on success, 0 on failure.
 
template<typename T , typename... Args>
static size_t Write (FILE *f, const std::tuple< T, Args... > &t)
 Writes a tuple to a FILE. Returns 1 on success, 0 on failure.
 
template<typename T >
static std::istream & ReadTuple (std::istream &is, T &t)
 T must be a tuple.
 
template<typename T >
static std::ostream & WriteTuple (std::ostream &os, const T &t)
 T must be a tuple.
 
template<typename T >
static ssize_t ReadTuple (int fd, T &t)
 T must be a tuple.
 
template<typename T >
static ssize_t WriteTuple (int fd, const T &t)
 T must be a tuple.
 
template<typename T >
static size_t ReadTuple (FILE *f, T &t)
 T must be a tuple.
 
template<typename T >
static size_t WriteTuple (FILE *f, const T &t)
 T must be a tuple.
 
template<typename T >
static uint32_t TupleStreamedLength (const T &t)
 T must be a tuple.
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static uint32_t StreamedLength (const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream & Read (std::istream &is, std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_map<_keyT,_valueT> from an istream. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Writes a unordered_map<_keyT,_valueT> to an ostream. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Read (int fd, std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_map<_keyT,_valueT> from a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Write (int fd, const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Writes an unordered_map<_keyT,_valueT> to a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Read (FILE *f, std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm)
 Reads an unordered_map from a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Write (FILE *f, const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm)
 Writes an unordered_map to a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static uint32_t StreamedLength (const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream & Read (std::istream &is, std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_multimap<_keyT,_valueT> from an istream. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Writes a unordered_multimap<_keyT,_valueT> to an ostream. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Read (int fd, std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_multimap<_keyT,_valueT> from a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Write (int fd, const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &m)
 Writes an unordered_multimap<_keyT,_valueT> to a file descriptor. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Read (FILE *f, std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm)
 Reads an unordered_multimap from a FILE pointer. More...
 
template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Write (FILE *f, const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm)
 Writes an unordered_multimap to a FILE pointer. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static uint32_t StreamedLength (const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m)
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream & Read (std::istream &is, std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_set<_valueT> from an istream. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m)
 Writes a unordered_set<_valueT> to an ostream. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Read (int fd, std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_set<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Write (int fd, const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &m)
 Writes an unordered_set<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Read (FILE *f, std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &hm)
 Reads an unordered_set from a FILE pointer. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Write (FILE *f, const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &hm)
 Writes an unordered_set to a FILE pointer. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static uint32_t StreamedLength (const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &m)
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream & Read (std::istream &is, std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_multiset<_valueT> from an istream. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream & Write (std::ostream &os, const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &m)
 Writes a unordered_multiset<_valueT> to an ostream. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Read (int fd, std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &m)
 Reads an unordered_multiset<_valueT> from a file descriptor. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Write (int fd, const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &m)
 Writes an unordered_multiset<_valueT> to a file descriptor. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Read (FILE *f, std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &hm)
 Reads an unordered_multiset from a FILE pointer. More...
 
template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Write (FILE *f, const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &hm)
 Writes an unordered_multiset to a FILE pointer. More...
 

Detailed Description

This class contains a collection of static functions for reading and writing simple types, in network byte order (MSB first).

It also contains functions to read and write strings. It also contains template functions to read and write STL deques, lists, vectors, maps, multimaps, sets and multisets. If you have an older version of gcc, there are functions for hash_maps and hash_sets. For gcc-4.2 and later, there are functions for tuple, unordered_map and unordered_set. We use our member functions to handle reading and writing simple types in the containers, and template functions to handle reading and writing other class types. For a user-defined class, the class must implement the Readable and Writable interfaces, since our template functions simply call out to them. Since templates are static polymorphism, you don't need to inherit from Readable and Writable, but you must implement the interfaces.

Member Function Documentation

◆ Read() [1/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
int16_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [2/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
uint16_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [3/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
int32_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [4/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
uint32_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [5/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
int64_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [6/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
uint64_t &  val 
)
static

Reads val from is, in network byte order (MSB first).

Returns is.

◆ Read() [7/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
float &  val 
)
static

Reads val from is, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns is.

◆ Read() [8/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
double &  val 
)
static

Reads val from is, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns is.

◆ Read() [9/63]

static std::istream& Dwm::IO::Read ( std::istream &  is,
std::string &  s 
)
static

Reads string s from is.

Since we write strings with a 32-bit length value preceding, and always write the terminating NULL, this function will always read at least 5 bytes on success.

◆ Read() [10/63]

static ssize_t Dwm::IO::Read ( int  fd,
char &  c 
)
static

Reads c from fd.

Returns the number of bytes read (1) on success, less on failure.

◆ Read() [11/63]

static ssize_t Dwm::IO::Read ( int  fd,
uint8_t &  c 
)
static

Reads c from fd.

Returns the number of bytes read (1) on success, less on failure.

◆ Read() [12/63]

static ssize_t Dwm::IO::Read ( int  fd,
bool &  b 
)
static

Reads b from fd.

Returns the number of bytes read (1) on success, less on failure.

◆ Read() [13/63]

static ssize_t Dwm::IO::Read ( int  fd,
int16_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (2) on success, less on failure.

◆ Read() [14/63]

static ssize_t Dwm::IO::Read ( int  fd,
uint16_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (2) on success, less on failure.

◆ Read() [15/63]

static ssize_t Dwm::IO::Read ( int  fd,
int32_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (4) on success, less on failure.

◆ Read() [16/63]

static ssize_t Dwm::IO::Read ( int  fd,
uint32_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (4) on success, less on failure.

◆ Read() [17/63]

static ssize_t Dwm::IO::Read ( int  fd,
int64_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (8) on success, less on failure.

◆ Read() [18/63]

static ssize_t Dwm::IO::Read ( int  fd,
uint64_t &  val 
)
static

Reads val from fd, in network byte order (MSB first).

Returns number of bytes read (8) on success, less on failure.

◆ Read() [19/63]

static ssize_t Dwm::IO::Read ( int  fd,
float &  val 
)
static

Reads val from fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns number of bytes read (4) on success, less on failure.

◆ Read() [20/63]

static ssize_t Dwm::IO::Read ( int  fd,
double &  val 
)
static

Reads val from fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns number of bytes read (8) on success, less on failure.

◆ Read() [21/63]

static ssize_t Dwm::IO::Read ( int  fd,
std::string &  s 
)
static

Reads s from fd.

Returns the number of bytes read on success, -1 on failure. Since we write strings with a 32-bit unsigned length value preceding the actual string, and always have a terminating NULL, this always reads at least 5 bytes on success.

◆ Read() [22/63]

static size_t Dwm::IO::Read ( FILE *  f,
char &  c 
)
static

Reads c from f.

Returns the number of bytes read (1 on success, 0 on failure).

◆ Read() [23/63]

static size_t Dwm::IO::Read ( FILE *  f,
uint8_t &  c 
)
static

Reads c from f.

Returns the number of bytes read (1 on success).

◆ Read() [24/63]

static size_t Dwm::IO::Read ( FILE *  f,
bool &  b 
)
static

Reads b from f.

Returns the number of bytes read (1 on success).

◆ Read() [25/63]

static size_t Dwm::IO::Read ( FILE *  f,
int16_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (2 on success).

◆ Read() [26/63]

static size_t Dwm::IO::Read ( FILE *  f,
uint16_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (2 on success).

◆ Read() [27/63]

static size_t Dwm::IO::Read ( FILE *  f,
int32_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (4 on success).

◆ Read() [28/63]

static size_t Dwm::IO::Read ( FILE *  f,
uint32_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (4 on success).

◆ Read() [29/63]

static size_t Dwm::IO::Read ( FILE *  f,
int64_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (8 on success).

◆ Read() [30/63]

static size_t Dwm::IO::Read ( FILE *  f,
uint64_t &  val 
)
static

Reads val from f, in network byte order (MSB first).

Returns the number of bytes read (8 on success).

◆ Read() [31/63]

static size_t Dwm::IO::Read ( FILE *  f,
float &  val 
)
static

Reads val from f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes read (4 on success).

◆ Read() [32/63]

static size_t Dwm::IO::Read ( FILE *  f,
double &  val 
)
static

Reads val from f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes read (8 on success).

◆ Read() [33/63]

static size_t Dwm::IO::Read ( FILE *  f,
std::string &  s 
)
static

Reads s from f.

Since we write strings with a 32-bit length value preceding, and always write the terminating NULL, this function will always return a value of 5 or greater on success.

◆ Read() [34/63]

template<typename _firstT , typename _secondT >
static size_t Dwm::IO::Read ( FILE *  f,
std::pair< _firstT, _secondT > &  p 
)
inlinestatic

Reads a pair<_firstT,_secondT> from a FILE pointer.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Read() [35/63]

template<typename _firstT , typename _secondT >
static ssize_t Dwm::IO::Read ( int  fd,
std::pair< _firstT, _secondT > &  p 
)
inlinestatic

Reads a pair<_firstT,_secondT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

Here is the call graph for this function:

◆ Read() [36/63]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::map< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Reads a map<_keyT,_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [37/63]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::map< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Reads a map<_keyT,_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [38/63]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static std::istream& Dwm::IO::Read ( std::istream &  is,
std::multimap< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Reads a multimap<_keyT,_valueT> from an istream.

Returns the istream.

◆ Read() [39/63]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::multimap< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Reads a multimap<_keyT,_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [40/63]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::multimap< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Reads a multimap<_keyT,_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [41/63]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::vector< _valueT, _Alloc > &  v 
)
inlinestatic

Reads a vector<_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [42/63]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::vector< _valueT, _Alloc > &  v 
)
inlinestatic

Reads a vector<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [43/63]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::deque< _valueT, _Alloc > &  d 
)
inlinestatic

Reads a deque<_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [44/63]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::deque< _valueT, _Alloc > &  d 
)
inlinestatic

Reads a deque<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [45/63]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::list< _valueT, _Alloc > &  l 
)
inlinestatic

Reads a list<_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [46/63]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::list< _valueT, _Alloc > &  l 
)
inlinestatic

Reads a list<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [47/63]

template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::set< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Reads a set<_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [48/63]

template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::set< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Reads a set<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [49/63]

template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::multiset< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Reads a multiset<_valueT> from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [50/63]

template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::multiset< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Reads a multiset<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [51/63]

template<typename T , typename... Args>
static ssize_t Dwm::IO::Read ( int  fd,
std::tuple< T, Args... > &  t 
)
inlinestatic

Reads a tuple from a file descriptor.

Returns the number of bytes read.

Here is the call graph for this function:

◆ Read() [52/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream& Dwm::IO::Read ( std::istream &  is,
std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_map<_keyT,_valueT> from an istream.

Returns the istream.

◆ Read() [53/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_map<_keyT,_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [54/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Reads an unordered_map from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [55/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream& Dwm::IO::Read ( std::istream &  is,
std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_multimap<_keyT,_valueT> from an istream.

Returns the istream.

◆ Read() [56/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_multimap<_keyT,_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [57/63]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Reads an unordered_multimap from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [58/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream& Dwm::IO::Read ( std::istream &  is,
std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_set<_valueT> from an istream.

Returns the istream.

◆ Read() [59/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_set<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [60/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Reads an unordered_set from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Read() [61/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::istream& Dwm::IO::Read ( std::istream &  is,
std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_multiset<_valueT> from an istream.

Returns the istream.

◆ Read() [62/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Read ( int  fd,
std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Reads an unordered_multiset<_valueT> from a file descriptor.

Returns the number of bytes read on success, -1 on failure.

◆ Read() [63/63]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Read ( FILE *  f,
std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Reads an unordered_multiset from a FILE pointer.

Returns 1 on success, 0 on failure.

◆ StreamedLength() [1/14]

static uint32_t Dwm::IO::StreamedLength ( char  c)
inlinestatic

Returns the number of bytes that would be written if we called Write() for a char.

Should always be 1.

Here is the call graph for this function:

◆ StreamedLength() [2/14]

static uint32_t Dwm::IO::StreamedLength ( uint8_t  c)
inlinestatic

Returns the number of bytes that would be written if we called Write() for a uint8_t.

Should always be 1.

Here is the call graph for this function:

◆ StreamedLength() [3/14]

static uint32_t Dwm::IO::StreamedLength ( bool  b)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for a bool.

Here is the call graph for this function:

◆ StreamedLength() [4/14]

static uint32_t Dwm::IO::StreamedLength ( int16_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for an int16_t.

Here is the call graph for this function:

◆ StreamedLength() [5/14]

static uint32_t Dwm::IO::StreamedLength ( uint16_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for a uint16_t.

Here is the call graph for this function:

◆ StreamedLength() [6/14]

static uint32_t Dwm::IO::StreamedLength ( int32_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for an int32_t.

Here is the call graph for this function:

◆ StreamedLength() [7/14]

static uint32_t Dwm::IO::StreamedLength ( uint32_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for a uint32_t.

Here is the call graph for this function:

◆ StreamedLength() [8/14]

static uint32_t Dwm::IO::StreamedLength ( int64_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for an int64_t.

Here is the call graph for this function:

◆ StreamedLength() [9/14]

static uint32_t Dwm::IO::StreamedLength ( uint64_t  val)
inlinestatic

Returns the number of bytes that would be written if we called one of the Write() members for a uint64_t.

Here is the call graph for this function:

◆ StreamedLength() [10/14]

static uint32_t Dwm::IO::StreamedLength ( float  val)
inlinestatic

Returns the number of bytes that should be written if we call one of the Write() members for a float.

Here is the call graph for this function:

◆ StreamedLength() [11/14]

static uint32_t Dwm::IO::StreamedLength ( double  val)
inlinestatic

Returns the number of bytes that should be written if we call one of the Write() members for a double.

Here is the call graph for this function:

◆ StreamedLength() [12/14]

static uint32_t Dwm::IO::StreamedLength ( const std::string &  s)
inlinestatic

Returns the number of bytes that should be written if we call one of the Write() members for a string.

Here is the call graph for this function:

◆ StreamedLength() [13/14]

static uint32_t Dwm::IO::StreamedLength ( const Writable val)
inlinestatic

Returns the number of bytes that should be written if we call one of the Write() members for a Writable val.

Here is the call graph for this function:

◆ StreamedLength() [14/14]

template<typename T , typename... Args>
static uint32_t Dwm::IO::StreamedLength ( const std::tuple< T, Args... > &  t)
inlinestatic

Returns the number of bytes that should be written if we call one of the Write() members for a tuple.

Here is the call graph for this function:

◆ Write() [1/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
int16_t  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [2/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
uint16_t  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [3/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
int32_t  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [4/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
uint32_t  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [5/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const int64_t &  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [6/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const uint64_t &  val 
)
static

Writes val to os, in network byte order (MSB first).

Returns os.

◆ Write() [7/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
float  val 
)
static

Writes val to os, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns os.

◆ Write() [8/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const double &  val 
)
static

Writes val to os, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns os.

◆ Write() [9/62]

static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const std::string &  s 
)
static

Writes s to os.

Note that the length of s is written first, as an unsigned 32-bit number in network byte order (MSB first). Hence at least 5 bytes will always be written; 4 for the length and 1 for the terminating NULL character of an empty string.

◆ Write() [10/62]

static ssize_t Dwm::IO::Write ( int  fd,
char  c 
)
static

Writes c to fd.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [11/62]

static ssize_t Dwm::IO::Write ( int  fd,
uint8_t  c 
)
static

Writes c to fd.

Returns the number of bytes written (1) on success, less on failure.

◆ Write() [12/62]

static ssize_t Dwm::IO::Write ( int  fd,
bool  b 
)
static

Writes b to fd.

Returns the number of bytes written (1) on success, less on failure.

◆ Write() [13/62]

static ssize_t Dwm::IO::Write ( int  fd,
int16_t  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (2) on success, less on failure.

◆ Write() [14/62]

static ssize_t Dwm::IO::Write ( int  fd,
uint16_t  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (2) on success, less on failure.

◆ Write() [15/62]

static ssize_t Dwm::IO::Write ( int  fd,
int32_t  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (4) on success, less on failure.

◆ Write() [16/62]

static ssize_t Dwm::IO::Write ( int  fd,
uint32_t  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (4) on success, less on failure.

◆ Write() [17/62]

static ssize_t Dwm::IO::Write ( int  fd,
const int64_t &  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (8) on success, less on failure.

◆ Write() [18/62]

static ssize_t Dwm::IO::Write ( int  fd,
const uint64_t &  val 
)
static

Writes val to fd, in network byte order (MSB first).

Returns the number of bytes written (8) on success, less on failure.

◆ Write() [19/62]

static ssize_t Dwm::IO::Write ( int  fd,
float  val 
)
static

Writes val to fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes written (4) on success, less on failure.

◆ Write() [20/62]

static ssize_t Dwm::IO::Write ( int  fd,
const double &  val 
)
static

Writes val to fd, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes written (8) on success, less on failure.

◆ Write() [21/62]

static ssize_t Dwm::IO::Write ( int  fd,
const std::string &  s 
)
static

Writes s to fd.

Returns the number of bytes written on success, -1 on failure. Note that a 32-bit value is written first, holding the length of the string. The terminating NULL is also written. Hence, on success this will always return a value of 5 or greater.

◆ Write() [22/62]

static size_t Dwm::IO::Write ( FILE *  f,
char  c 
)
static

Writes c to f.

Returns the number of bytes written (1) on success.

◆ Write() [23/62]

static size_t Dwm::IO::Write ( FILE *  f,
uint8_t  c 
)
static

Writes c to f.

Returns the number of bytes written (1) on success.

◆ Write() [24/62]

static size_t Dwm::IO::Write ( FILE *  f,
bool  b 
)
static

Writes b to f.

Returns the number of bytes written (1) on success.

◆ Write() [25/62]

static size_t Dwm::IO::Write ( FILE *  f,
int16_t  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (2) on success.

◆ Write() [26/62]

static size_t Dwm::IO::Write ( FILE *  f,
uint16_t  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (2) on success.

◆ Write() [27/62]

static size_t Dwm::IO::Write ( FILE *  f,
int32_t  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (4) on success.

◆ Write() [28/62]

static size_t Dwm::IO::Write ( FILE *  f,
uint32_t  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (4) on success.

◆ Write() [29/62]

static size_t Dwm::IO::Write ( FILE *  f,
const int64_t &  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (8) on success.

◆ Write() [30/62]

static size_t Dwm::IO::Write ( FILE *  f,
const uint64_t &  val 
)
static

Writes val to f, in network byte order (MSB first).

Returns the number of bytes written (8) on success.

◆ Write() [31/62]

static size_t Dwm::IO::Write ( FILE *  f,
float  val 
)
static

Writes val to f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes written (4 on success).

◆ Write() [32/62]

static size_t Dwm::IO::Write ( FILE *  f,
const double &  val 
)
static

Writes val to f, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).

Returns the number of bytes written (8 on success).

◆ Write() [33/62]

static size_t Dwm::IO::Write ( FILE *  f,
const std::string &  s 
)
static

Writes s to f.

Returns the number of bytes written. Note that we first write a 32-bit length value, then the string itself (with terminating NULL). Hence a successful write will always return a value of 4 + s.length() + 1.

◆ Write() [34/62]

template<typename _firstT , typename _secondT >
static size_t Dwm::IO::Write ( FILE *  f,
const std::pair< _firstT, _secondT > &  p 
)
inlinestatic

Writes a pair<_firstT,_secondT> to a FILE pointer.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Write() [35/62]

template<typename _firstT , typename _secondT >
static ssize_t Dwm::IO::Write ( int  fd,
const std::pair< _firstT, _secondT > &  p 
)
inlinestatic

Writes a pair<_firstT,_secondT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

Here is the call graph for this function:

◆ Write() [36/62]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::map< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Writes a map<_keyT,_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [37/62]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::map< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Writes a map<_keyT,_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [38/62]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::multimap< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Writes a multimap<_keyT,_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [39/62]

template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::multimap< _keyT, _valueT, _Compare, _Alloc > &  m 
)
inlinestatic

Writes a multimap<_keyT,_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [40/62]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::vector< _valueT, _Alloc > &  v 
)
inlinestatic

Writes a vector<_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [41/62]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::vector< _valueT, _Alloc > &  v 
)
inlinestatic

Writes a vector<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [42/62]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::deque< _valueT, _Alloc > &  d 
)
inlinestatic

Writes a deque<_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [43/62]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::deque< _valueT, _Alloc > &  d 
)
inlinestatic

Writes a deque<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [44/62]

template<typename _valueT , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::list< _valueT, _Alloc > &  l 
)
inlinestatic

Writes a list<_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [45/62]

template<typename _valueT , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::list< _valueT, _Alloc > &  l 
)
inlinestatic

Writes a list<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [46/62]

template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::set< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Writes a set<_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [47/62]

template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::set< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Writes a set<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [48/62]

template<typename _valueT , typename _Compare , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::multiset< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Writes a multiset<_valueT> to a FILE pointer.

Returns 1 on success, 0 on failure.

◆ Write() [49/62]

template<typename _valueT , typename _Compare , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::multiset< _valueT, _Compare, _Alloc > &  l 
)
inlinestatic

Writes a multiset<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

Here is the call graph for this function:

◆ Write() [50/62]

template<typename T , typename... Args>
static ssize_t Dwm::IO::Write ( int  fd,
const std::tuple< T, Args... > &  t 
)
inlinestatic

Writes a tuple to a file descriptor.

Returns the number of bytes written.

Here is the call graph for this function:

◆ Write() [51/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes a unordered_map<_keyT,_valueT> to an ostream.

Returns the ostream.

◆ Write() [52/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes an unordered_map<_keyT,_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [53/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Writes an unordered_map to a FILE pointer.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Write() [54/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes a unordered_multimap<_keyT,_valueT> to an ostream.

Returns the ostream.

◆ Write() [55/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes an unordered_multimap<_keyT,_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [56/62]

template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Writes an unordered_multimap to a FILE pointer.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Write() [57/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes a unordered_set<_valueT> to an ostream.

Returns the ostream.

◆ Write() [58/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes an unordered_set<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [59/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Writes an unordered_set to a FILE pointer.

Returns 1 on success, 0 on failure.

Here is the call graph for this function:

◆ Write() [60/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static std::ostream& Dwm::IO::Write ( std::ostream &  os,
const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes a unordered_multiset<_valueT> to an ostream.

Returns the ostream.

◆ Write() [61/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static ssize_t Dwm::IO::Write ( int  fd,
const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  m 
)
inlinestatic

Writes an unordered_multiset<_valueT> to a file descriptor.

Returns the number of bytes written on success, -1 on failure.

◆ Write() [62/62]

template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc >
static size_t Dwm::IO::Write ( FILE *  f,
const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &  hm 
)
inlinestatic

Writes an unordered_multiset to a FILE pointer.

Returns 1 on success, 0 on failure.


The documentation for this class was generated from the following file: