Coverage Report

Created: 2026-04-29 07:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libzmf/src/lib/ZMF4Header.cpp
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/*
3
 * This file is a part of the libzmf project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#include "ZMF4Header.h"
11
12
13
79.9k
#define ZMF4_SIGNATURE 0x12345678
14
15
16
namespace libzmf
17
{
18
19
ZMF4Header::ZMF4Header()
20
43.2k
  : m_signature(0)
21
43.2k
  , m_objectCount(0)
22
43.2k
  , m_startContentOffset(0)
23
43.2k
  , m_startBitmapOffset(0)
24
43.2k
{
25
43.2k
}
26
27
bool ZMF4Header::load(const RVNGInputStreamPtr &input)
28
43.2k
{
29
43.2k
  seek(input, 8);
30
31
43.2k
  m_signature = readU32(input);
32
33
43.2k
  if (!checkSignature())
34
6.45k
    return false;
35
36
36.8k
  seek(input, 28);
37
38
36.8k
  m_objectCount = readU32(input);
39
40
36.8k
  m_startContentOffset = readU32(input);
41
42
36.8k
  m_startBitmapOffset = readU32(input);
43
44
36.8k
  return true;
45
43.2k
}
46
47
bool ZMF4Header::isSupported() const
48
36.7k
{
49
36.7k
  return checkSignature();
50
36.7k
}
51
52
uint32_t ZMF4Header::objectCount() const
53
0
{
54
0
  return m_objectCount;
55
0
}
56
57
uint32_t ZMF4Header::startContentOffset() const
58
18.1k
{
59
18.1k
  return m_startContentOffset;
60
18.1k
}
61
62
uint32_t ZMF4Header::startBitmapOffset() const
63
18.5k
{
64
18.5k
  return m_startBitmapOffset;
65
18.5k
}
66
67
bool ZMF4Header::checkSignature() const
68
79.9k
{
69
79.9k
  return m_signature == ZMF4_SIGNATURE;
70
79.9k
}
71
72
}
73
74
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */