#include <ChunkFile.hpp>
Classes | |
struct | Chunk |
Public Member Functions | |
ChunkFile () | |
~ChunkFile () | |
void | open (const std::string &path, const std::string &mode) |
void | close () |
void | seek (uint64_t offset) |
void | skip (uint64_t nbyte) |
void | read (Chunk &chunk) |
void | read (uint8_t *buffer, uint64_t nbyte) |
void | write (const Chunk &chunk) |
void | write (const uint8_t *buffer, uint64_t nbyte) |
void | validate (const Chunk &chunk, uint32_t type, uint8_t majorVersion, uint8_t minorVersion) const |
bool | eof () const |
uint64_t | size () const |
uint64_t | offset () const |
const std::string & | path () const |
Private Member Functions | |
std::string | status () const |
Private Attributes | |
File | file_ |
Simplified PNG/IFF like binary file format. It contains series of chunks. The first chunk type provides file signature. Each chunk contains both metadata (header) and data. Chunk bytes are { sizeof(Chunk), headerLength, dataLength }. The maximum length of chunk data is 64-bit value (16 exabytes). All multi-byte integers are in little-endian format. All integers should be aligned to file offsets by their size.
ChunkFile::ChunkFile | ( | ) |
ChunkFile::~ChunkFile | ( | ) |
void ChunkFile::close | ( | ) |
Referenced by IndexFile::read(), IndexFile::read(), IndexFileBuilder::stateNodeEnd(), and IndexFile::write().
bool ChunkFile::eof | ( | ) | const |
uint64_t ChunkFile::offset | ( | ) | const |
Referenced by seek(), IndexFileBuilder::stateNodeInsert(), and status().
void ChunkFile::open | ( | const std::string & | path, |
const std::string & | mode ) |
Referenced by IndexFile::read(), IndexFile::read(), IndexFileBuilder::stateMainEnd(), and IndexFile::write().
void ChunkFile::read | ( | ChunkFile::Chunk & | chunk | ) |
Referenced by IndexFile::read(), and IndexFile::readPayload().
void ChunkFile::read | ( | uint8_t * | buffer, |
uint64_t | nbyte ) |
void ChunkFile::seek | ( | uint64_t | offset | ) |
Referenced by IndexFile::read(), and IndexFileBuilder::stateNodeEnd().
uint64_t ChunkFile::size | ( | ) | const |
void ChunkFile::skip | ( | uint64_t | nbyte | ) |
|
private |
Referenced by validate().
void ChunkFile::validate | ( | const Chunk & | chunk, |
uint32_t | type, | ||
uint8_t | majorVersion, | ||
uint8_t | minorVersion ) const |
Referenced by IndexFile::readPayload().
void ChunkFile::write | ( | const Chunk & | chunk | ) |
Referenced by IndexFile::write().
void ChunkFile::write | ( | const uint8_t * | buffer, |
uint64_t | nbyte ) |
|
private |