FlatCityBuf C++ reader 0.8.0
Native C++17 reader for FlatCityBuf, the cloud-optimized CityJSON format
Loading...
Searching...
No Matches
layout.hpp File Reference
#include <fcb/error.hpp>
#include <fcb/span.hpp>
#include <cstdint>

Go to the source code of this file.

Classes

struct  fcb::FileLayout
 Byte offsets of each section. More...
 

Namespaces

namespace  fcb
 

Functions

bool fcb::check_magic_bytes (bytes_view b)
 Mirrors fcb_core::check_magic_bytes (src/rust/fcb_core/src/lib.rs:56-58).
 
std::uint64_t fcb::rtree_index_size (std::uint64_t num_items, std::uint16_t node_size)
 Mirrors PackedRTree::index_size (packed_rtree/mod.rs:879-898).
 
FileLayout fcb::compute_layout (std::uint32_t header_size, std::uint64_t features_count, std::uint16_t index_node_size, std::uint64_t attr_index_size)
 Throws fcb::Error{IllegalHeaderSize} when header_size is out of range or any size arithmetic overflows.
 
void fcb::validate_layout_against_size (const FileLayout &l, std::uint64_t total_size)
 Throws unless the computed sections fit inside the resource.
 

Variables

constexpr std::size_t fcb::kMagicBytesSize = 8
 
constexpr std::size_t fcb::kHeaderSizeSize = 4
 
constexpr std::size_t fcb::kHeaderMinBufferSize = 8
 
constexpr std::size_t fcb::kHeaderMaxBufferSize = 1024ULL * 1024ULL * 512ULL
 
constexpr std::uint8_t fcb::kVersion = 1
 
constexpr std::size_t fcb::kNodeItemSize = 40
 
constexpr std::uint16_t fcb::kDefaultNodeSize = 16
 
constexpr std::uint64_t fcb::kMaxFeatureSize = 256ULL * 1024ULL * 1024ULL
 Hard ceiling on a single feature's byte length, enforced before allocating.