FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
fcb::FileRangeReader Class Reference

Local-file adapter. More...

#include <fcb/range_reader.hpp>

Inheritance diagram for fcb::FileRangeReader:
fcb::RangeReader

Public Member Functions

 FileRangeReader (const std::string &path)
 
std::uint64_t total_size () override
 Total byte length of the resource.
 
std::vector< std::uint8_t > read (std::uint64_t offset, std::uint64_t length) override
 Read length bytes at offset, subject to the contract above.
 
- Public Member Functions inherited from fcb::RangeReader
virtual ~RangeReader ()=default
 
virtual void read_batch (std::vector< RangeRequest > &requests)
 Fill every request, preserving order.
 

Detailed Description

Local-file adapter.

Definition at line 72 of file range_reader.hpp.

Constructor & Destructor Documentation

◆ FileRangeReader()

fcb::FileRangeReader::FileRangeReader ( const std::string &  path)
explicit

Definition at line 17 of file range_reader.cpp.

References fcb::IoError.

Member Function Documentation

◆ read()

std::vector< std::uint8_t > fcb::FileRangeReader::read ( std::uint64_t  offset,
std::uint64_t  length 
)
overridevirtual

Read length bytes at offset, subject to the contract above.

Implements fcb::RangeReader.

Definition at line 27 of file range_reader.cpp.

References fcb::IoError, and offset.

◆ total_size()

std::uint64_t fcb::FileRangeReader::total_size ( )
overridevirtual

Total byte length of the resource.

This is a REQUIRED bounds/security contract, not a convenience: every computed section offset and range request is validated against it, so a corrupt header cannot make the core read or allocate out of bounds. (It is NOT needed to size the last feature – every feature carries its own 4-byte size prefix.)

Implements fcb::RangeReader.

Definition at line 25 of file range_reader.cpp.


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