This class contains a collection of static functions for reading and writing simple types in network byte order (MSB first) from/to gzip files. More...
#include <DwmGZIO.hh>
Static Public Member Functions | |
| static int | Read (gzFile gzf, char &c) |
Reads from gzf. | |
| static int | Write (gzFile gzf, char c) |
Writes c to gzf. | |
| static int | Read (gzFile gzf, uint8_t &c) |
Reads c from gzf. | |
| static int | Write (gzFile gzf, uint8_t c) |
Writes c to gzf. | |
| static int | Read (gzFile gzf, bool &b) |
Reads b from gzf. | |
| static int | Write (gzFile gzf, bool b) |
Writes b to gzf. | |
| static int | Read (gzFile gzf, int16_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, int16_t val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, uint16_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, uint16_t val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, int32_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, int32_t val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, uint32_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, uint32_t val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, int64_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, const int64_t &val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, uint64_t &val) |
Reads val from gzf, in network byte order (MSB first). | |
| static int | Write (gzFile gzf, const uint64_t &val) |
Writes val to gzf, in network byte order (MSB first). | |
| static int | Read (gzFile gzf, float &val) |
Reads val from gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). | |
| static int | Write (gzFile gzf, float val) |
Writes val tp gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). | |
| static int | Read (gzFile gzf, double &val) |
Reads val from gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). | |
| static int | Write (gzFile gzf, const double &val) |
Writes val tp gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985). | |
| static int | Read (gzFile gzf, std::string &s) |
Reads s from gzf. | |
| static int | Write (gzFile gzf, const std::string &s) |
Writes s to gzf. | |
| static int | Read (gzFile gzf, GZReadable &val) |
| Wrapper function to read a GZReadable object from a gzFile. | |
| static int | Read (gzFile gzf, HasGZRead auto &val) |
Reads val from gzf, where val meets the requirements of the HasGZRead concept. | |
| static int | Write (gzFile gzf, const GZWritable &val) |
| Wrapper function to write a GZWritable object to a gzFile. | |
| static int | Write (gzFile gzf, const HasGZWrite auto &val) |
Writes val to gzf, where val meets the requirements of the HasGZWrite concept. | |
| template<typename _firstT , typename _secondT > | |
| static int | Read (gzFile gzf, std::pair< _firstT, _secondT > &p) |
| Reads a pair<_firstT,_secondT> from a gzFile. | |
| template<typename _firstT , typename _secondT > | |
| static int | Write (gzFile gzf, const std::pair< _firstT, _secondT > &p) |
| Writes a pair<_firstT,_secondT> to a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Read (gzFile gzf, std::map< _keyT, _valueT, _Compare, _Alloc > &m) |
| Reads a map<_keyT,_valueT> from a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::map< _keyT, _valueT, _Compare, _Alloc > &m) |
| Writes a map<_keyT,_valueT> to a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Read (gzFile gzf, std::multimap< _keyT, _valueT, _Compare, _Alloc > &m) |
| Reads a multimap<_keyT,_valueT> from a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::multimap< _keyT, _valueT, _Compare, _Alloc > &m) |
| Writes a multimap<_keyT,_valueT> to a gzFile. | |
| template<typename _valueT , size_t N> | |
| static int | Read (gzFile gzf, std::array< _valueT, N > &a) |
| Reads an array<_valueT,N> from a gzFile. | |
| template<typename _valueT , size_t N> | |
| static int | Write (gzFile gzf, const std::array< _valueT, N > &a) |
| Writes an array<_valueT,N> to a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Read (gzFile gzf, std::vector< _valueT, _Alloc > &v) |
| Reads a vector<_valueT> from a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::vector< _valueT, _Alloc > &v) |
| Writes a vector<_valueT> to a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Read (gzFile gzf, std::deque< _valueT, _Alloc > &d) |
| Reads a deque<_valueT> from a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::deque< _valueT, _Alloc > &d) |
| Writes a deque<_valueT> to a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Read (gzFile gzf, std::list< _valueT, _Alloc > &l) |
| Reads a list<_valueT> from a gzFile. | |
| template<typename _valueT , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::list< _valueT, _Alloc > &l) |
| Writes a list<_valueT> to a gzFile. | |
| template<typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Read (gzFile gzf, std::set< _valueT, _Compare, _Alloc > &l) |
| Reads a set<_valueT> from a gzFile. | |
| template<typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::set< _valueT, _Compare, _Alloc > &l) |
| Writes a set<_valueT> to a gzFile. | |
| template<typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Read (gzFile gzf, std::multiset< _valueT, _Compare, _Alloc > &l) |
| Reads a multiset<_valueT> from a gzFile. | |
| template<typename _valueT , typename _Compare , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::multiset< _valueT, _Compare, _Alloc > &l) |
| Writes a multiset<_valueT> to a gzFile. | |
| static int | Read (gzFile gzf, std::monostate &sm) |
| Just a dummy helper function for std::variant instances that hold a std::monostate. | |
| static int | Write (gzFile gzf, const std::monostate &sm) |
| Just a dummy helper function for std::variant instances that hold a std::monostate. | |
| template<typename... Ts> | |
| static int | Read (gzFile gzf, std::variant< Ts... > &v) |
| Reads a variant from a gzFile. | |
| template<typename... Ts> | |
| static int | Write (gzFile gzf, const std::variant< Ts... > &v) |
| Writes a variant to a gzFile. | |
| template<typename... Args> | |
| static int | Read (gzFile gzf, std::tuple< Args... > &t) |
| Reads a tuple from a gzFile. | |
| template<typename... Args> | |
| static int | Write (gzFile gzf, const std::tuple< Args... > &t) |
| Writes a tuple to a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Read (gzFile gzf, std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm) |
| Reads an unordered_map from a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::unordered_map< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm) |
| Writes an unordered_map to a gzFile. | |
| template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Read (gzFile gzf, std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &hm) |
| Reads an unordered_set from a gzFile. | |
| template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::unordered_set< _valueT, _Hash, _Pred, _Alloc > &hm) |
| Writes an unordered_set to a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Read (gzFile gzf, std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm) |
| Reads an unordered_multimap from a gzFile. | |
| template<typename _keyT , typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::unordered_multimap< _keyT, _valueT, _Hash, _Pred, _Alloc > &hm) |
| Writes an unordered_multimap to a gzFile. | |
| template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Read (gzFile gzf, std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &hm) |
| Reads an unordered_multiset from a gzFile. | |
| template<typename _valueT , typename _Hash , typename _Pred , typename _Alloc > | |
| static int | Write (gzFile gzf, const std::unordered_multiset< _valueT, _Hash, _Pred, _Alloc > &hm) |
| Writes an unordered_multiset to a gzFile. | |
| template<typename ... Args> | |
| static int | ReadV (gzFile gzf, Args &...args) |
Reads args from gzf. | |
| template<typename ... Args> | |
| static int | WriteV (gzFile gzf, const Args &...args) |
Writes args to gzf. | |
This class contains a collection of static functions for reading and writing simple types in network byte order (MSB first) from/to gzip files.
It also contains functions to read and write strings from/to gzip files. It also contains function templates to read and write arrays, deques, lists, vectors, maps, multimaps, sets, multisets, unordered_maps, unordered_multimaps, unordered_sets, unordered_multisets, tuples and variants from/to gzip files. We use our member functions to handle reading and writing simple types in these containers, and function templates to handle reading and writing other class types. In the latter case, the class must implement the GZReadable and GZWritable interfaces, since our function templates simply call out to them.
|
static |
Reads b from gzf.
Returns the number of bytes read (1) on success, less on failure.
|
static |
Reads from gzf.
Returns the number of bytes read (1) on success, less on failure.
|
static |
Reads val from gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
Returns number of bytes read (8) on success, less on failure.
|
static |
Reads val from gzf, in IEEE format (see RFC 1832 and/or ANSI/IEEE Standard 754-1985).
Returns number of bytes read (4) on success, less on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (2) on success, less on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (4) on success, less on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (8) on success, less on failure.
|
inlinestatic |
Reads an array<_valueT,N> from a gzFile.
Returns the number of bytes read on success, -1 on failure.

|
inlinestatic |
Reads a deque<_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads a list<_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads a map<_keyT,_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Just a dummy helper function for std::variant instances that hold a std::monostate.
This should only be called from our Read() for std::variant (via std::visit()), and does nothing. Returns 0.
|
inlinestatic |
Reads a multimap<_keyT,_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads a multiset<_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads a pair<_firstT,_secondT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.

|
inlinestatic |
Reads a set<_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
static |
Reads s from gzf.
Returns the number of bytes read on success, -1 on failure. Since we write strings with a 64-bit unsigned length value preceding the actual string, and always have a terminating NULL, this always reads at least 9 bytes on success.
|
inlinestatic |
Reads a tuple from a gzFile.
Returns the number of bytes read on success, -1 on failure.

|
inlinestatic |
Reads an unordered_map from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads an unordered_multimap from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads an unordered_multiset from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads an unordered_set from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
inlinestatic |
Reads a variant from a gzFile.
Returns the number of bytes read on success, -1 on failure.

|
inlinestatic |
Reads a vector<_valueT> from a gzFile.
Returns the number of bytes read on success, -1 on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (2) on success, less on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (4) on success, less on failure.
|
static |
Reads val from gzf, in network byte order (MSB first).
Returns number of bytes read (8) on success, less on failure.
|
static |
Reads c from gzf.
Returns the number of bytes read (1) on success, less on failure.
|
inlinestatic |
Reads args from gzf.
Returns the number of bytes read on success, -1 on failure.

|
static |
Writes b to gzf.
Returns the number of bytes written (1) on success, less on failure.
|
static |
Writes c to gzf.
Returns the number of bytes written on success, -1 on failure.
|
static |
Writes val tp gzf, 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.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (8) on success, less on failure.
|
inlinestatic |
Writes an array<_valueT,N> to a gzFile.
Returns the number of bytes written on success, -1 on failure.

|
inlinestatic |
Writes a deque<_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes a list<_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes a map<_keyT,_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Just a dummy helper function for std::variant instances that hold a std::monostate.
This should only be called from our Write() for std::variant (via std::visit()), and does nothing. Returns 0.
|
inlinestatic |
Writes a multimap<_keyT,_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes a multiset<_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes a pair<_firstT,_secondT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.

|
inlinestatic |
Writes a set<_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
static |
Writes s to gzf.
Returns the number of bytes written on success, -1 on failure. Note that a 64-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 9 or greater.
|
inlinestatic |
Writes a tuple to a gzFile.
Returns the number of bytes written on success, -1 on faiulure.

|
inlinestatic |
Writes an unordered_map to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes an unordered_multimap to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes an unordered_multiset to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes an unordered_set to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
inlinestatic |
Writes a variant to a gzFile.
Returns the number of bytes written on success, -1 on failure.

|
inlinestatic |
Writes a vector<_valueT> to a gzFile.
Returns the number of bytes written on success, -1 on failure.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (8) on success, less on failure.
|
static |
Writes val tp gzf, 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.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (2) on success, less on failure.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (4) on success, less on failure.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (2) on success, less on failure.
|
static |
Writes val to gzf, in network byte order (MSB first).
Returns the number of bytes written (4) on success, less on failure.
|
static |
Writes c to gzf.
Returns the number of bytes written (1) on success, less on failure.
|
inlinestatic |
Writes args to gzf.
Returns the number of bytes written on success, -1 on failure.
