File indexing completed on 2024-05-12 04:42:18

0001 /*
0002     SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef OSM_O5M_H
0007 #define OSM_O5M_H
0008 
0009 #include <cstdint>
0010 
0011 /** @file o5m.h
0012  *  Common declarations for O5M file format I/O.
0013  */
0014 
0015 namespace OSM {
0016 
0017 enum : uint8_t {
0018     O5M_BLOCK_RESET = 0xff,
0019     O5M_BLOCK_NODE = 0x10,
0020     O5M_BLOCK_WAY = 0x11,
0021     O5M_BLOCK_RELATION = 0x12,
0022     O5M_BLOCK_BOUNDING_BOX = 0xdb,
0023     O5M_BLOCK_TIMESTAMP = 0xdc,
0024     O5M_BLOCK_HEADER = 0xe0,
0025 
0026     O5M_NUMBER_CONTINUATION = 0b1000'0000,
0027     O5M_NUMBER_MASK = 0b0111'1111,
0028     O5M_NUMBER_SIGNED_BIT = 0b1,
0029 
0030     O5M_MEMTYPE_NODE = 0x30,
0031     O5M_MEMTYPE_WAY = 0x31,
0032     O5M_MEMTYPE_RELATION = 0x32,
0033 
0034     O5M_TRAILER = 0xfe,
0035 };
0036 
0037 enum : uint16_t {
0038     O5M_STRING_TABLE_SIZE = 15000,
0039     O5M_STRING_TABLE_MAXLEN = 250,
0040 };
0041 
0042 constexpr inline const char O5M_HEADER[] = "o5m2";
0043 
0044 }
0045 
0046 #endif