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

A parsed header that OWNS its backing bytes. More...

#include <fcb/header.hpp>

Public Member Functions

 HeaderView ()=default
const FileInfo & info () const
const FileLayout & layout () const
const std::vector< AttrIndexInfo > & attr_indices () const

Friends

struct detail::HeaderAccess
HeaderView read_header (std::shared_ptr< RangeReader > reader)
 Read and validate the file preamble and header.

Detailed Description

A parsed header that OWNS its backing bytes.

The raw ::Header pointer is deliberately not exposed: a caller could retain it past this object's destruction and read freed memory. Internal decoders reach it through detail::HeaderAccess.

Definition at line 111 of file header.hpp.

Constructor & Destructor Documentation

◆ HeaderView()

fcb::HeaderView::HeaderView ( )
default

Referenced by detail::HeaderAccess, and read_header.

Member Function Documentation

◆ attr_indices()

const std::vector< AttrIndexInfo > & fcb::HeaderView::attr_indices ( ) const
inline

Definition at line 117 of file header.hpp.

◆ info()

const FileInfo & fcb::HeaderView::info ( ) const
inline

Definition at line 115 of file header.hpp.

Referenced by fcb::to_cityjson_feature(), and fcb::to_cityjson_metadata().

◆ layout()

const FileLayout & fcb::HeaderView::layout ( ) const
inline

Definition at line 116 of file header.hpp.

◆ detail::HeaderAccess

friend struct detail::HeaderAccess
friend

Definition at line 120 of file header.hpp.

References HeaderView().

◆ read_header

HeaderView read_header ( std::shared_ptr< RangeReader > reader)
friend

Read and validate the file preamble and header.

Takes SHARED ownership so it can construct its own per-query BufferedRangeReader internally (over-fetching the header plus the top R-tree levels in one request, as the Rust HTTP reader does).

Definition at line 200 of file header.cpp.

References HeaderView(), fcb::FileLayout::attr_index_begin, fcb::check_magic_bytes(), fcb::detail::checked_add(), fcb::compute_layout(), fcb::FileInfo::features_count, fcb::IllegalHeaderSize, fcb::FileInfo::index_node_size, fcb::InvalidFlatbuffer, fcb::IoError, fcb::kBodyAlignPad, fcb::kHeaderMaxBufferSize, fcb::kHeaderSizeSize, fcb::kMagicBytesSize, fcb::MissingMagicBytes, fcb::BufferedRangeReader::read(), and fcb::validate_layout_against_size().


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