19 #ifndef TORC_ARCHITECTURE_DIGESTSTREAM_HPP
20 #define TORC_ARCHITECTURE_DIGESTSTREAM_HPP
23 #include <boost/filesystem/convenience.hpp>
24 #include <boost/cstdint.hpp>
25 #include "torc/externals/zlib/contrib/iostream3/zfstream.h"
28 namespace architecture {
58 gzifstream::read(static_cast<char*>(sectionHeader),
sizeof(sectionHeader));
60 outHeader.assign(sectionHeader,
sizeof(sectionHeader));
64 std::istream&
read(uint8_t& outValue) {
65 gzifstream::read(reinterpret_cast<char*>(&outValue),
sizeof(uint8_t));
73 gzifstream::read(reinterpret_cast<char*>(&outValue),
sizeof(
uint16_t));
74 outValue = ntohs(outValue);
81 gzifstream::read(reinterpret_cast<char*>(&outValue),
sizeof(
uint32_t));
82 outValue = ntohl(outValue);
91 std::istream&
read(
char* s, std::streamsize n) {
92 gzifstream::read(s, n);
101 #endif // TORC_ARCHITECTURE_DIGESTSTREAM_HPP
std::istream & read(uint8_t &outValue)
Read and return a uint8_t.
boost::uint16_t uint16_t
Imported type name.
DigestStream(const boost::filesystem::path &inPath)
Public constructor.
std::istream & read(char *s, std::streamsize n)
Read and return a character string.
size_t mBytesRead
The number of bytes read.
std::istream & read(uint32_t &outValue)
Read and return a uint32_t.
boost::filesystem::path path
boost::uint32_t uint32_t
Imported type name.
void readSectionHeader(string &outHeader)
Read and return a section header.
char DigestSectionHeader[16]
Definition of a digest section header.
std::istream & read(uint16_t &outValue)
Read and return a uint16_t.
std::string string
Imported type name.
Encapsulation of a device or family digest stream.
size_t getBytesRead(void) const
Returns the number of bytes read.
Header for endian conversion.