Welcome to mirror list, hosted at ThFree Co, Russian Federation.

slof.hpp « words - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b2edc4e809d807cf8819706e8a245442767ac2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
// slof = sloynik format.
//
// VU = VarUint.
//
// Offset:               Format:
//
// 0                     [Header]
// m_ArticleOffset       [VU ChunkSize] [Compressed article chunk 0]
//                       ..
//                       [VU ChunkSize] [Compressed article chunk n-1]
// m_KeyDataOffset       [VU KeySize] [Key 0]
//                       ..
//                       [VU KeySize] [Key m_KeyCount-1]
// m_KeyArticleIdOffset  [VU article 0 chunk offset]                [VU article 0 number in chunk]
//                       ..
//                       [VU article m_ArticleCount-1 chunk offset] [VU article * number in chunk]
//
// ArticleId = ([Offset of article chunk] << 24) + [Offset of article in uncompressed chunk]

#include "../coding/endianness.hpp"
#include "../base/base.hpp"

namespace sl
{

#pragma pack(push, 1)
struct SlofHeader
{
  uint32_t m_Signature;           // = "slof"
  uint16_t m_MajorVersion;        // Major version. Changing it breaks compatibility.
  uint16_t m_MinorVersion;        // Minor version. Changing it doesn't break compatibility.

  uint32_t m_KeyCount;            // Number of keys.
  uint32_t m_ArticleCount;        // Number of articles.

  uint64_t m_KeyIndexOffset;      // Offset of key cummulative lengthes.
  uint64_t m_KeyDataOffset;       // Offset of key data.
  uint64_t m_ArticleOffset;       // Offset of article data.
};
#pragma pack(pop)

}