3D Forest
Software for analysis of Lidar data from forest environment.
ChunkFile Class Reference

#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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ChunkFile()

ChunkFile::ChunkFile ( )

◆ ~ChunkFile()

ChunkFile::~ChunkFile ( )

Member Function Documentation

◆ close()

◆ eof()

bool ChunkFile::eof ( ) const

◆ offset()

uint64_t ChunkFile::offset ( ) const

◆ open()

void ChunkFile::open ( const std::string & path,
const std::string & mode )

◆ path()

const std::string & ChunkFile::path ( ) const

Referenced by open(), and status().

◆ read() [1/2]

void ChunkFile::read ( ChunkFile::Chunk & chunk)

◆ read() [2/2]

void ChunkFile::read ( uint8_t * buffer,
uint64_t nbyte )

◆ seek()

void ChunkFile::seek ( uint64_t offset)

◆ size()

uint64_t ChunkFile::size ( ) const

◆ skip()

void ChunkFile::skip ( uint64_t nbyte)

◆ status()

std::string ChunkFile::status ( ) const
private

Referenced by validate().

◆ validate()

void ChunkFile::validate ( const Chunk & chunk,
uint32_t type,
uint8_t majorVersion,
uint8_t minorVersion ) const

Referenced by IndexFile::readPayload().

◆ write() [1/2]

void ChunkFile::write ( const Chunk & chunk)

Referenced by IndexFile::write().

◆ write() [2/2]

void ChunkFile::write ( const uint8_t * buffer,
uint64_t nbyte )

Member Data Documentation

◆ file_

File ChunkFile::file_
private

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