Coverage Report

Created: 2026-10-28 06:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libzmf/src/lib/ZBRHeader.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 "ZBRHeader.h"
11
12
920
#define ZBR_SIG 0x29a
13
14
namespace libzmf
15
{
16
17
ZBRHeader::ZBRHeader()
18
2.46k
  : m_sig(0)
19
2.46k
  , m_version(0)
20
2.46k
{
21
2.46k
}
22
23
2.46k
bool ZBRHeader::load(const RVNGInputStreamPtr &input) try
24
2.46k
{
25
2.46k
  m_sig = readU16(input);
26
2.46k
  m_version = readU16(input);
27
2.46k
  skip(input, 100);
28
2.46k
  return true;
29
2.46k
}
30
2.46k
catch (...)
31
2.46k
{
32
2.00k
  return false;
33
2.00k
}
34
35
bool ZBRHeader::isSupported() const
36
460
{
37
460
  return m_sig == ZBR_SIG && m_version < 5;
38
460
}
39
40
unsigned ZBRHeader::version() const
41
0
{
42
0
  return m_version;
43
0
}
44
45
}
46
47
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */