Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/font/FontDataContainer.hxx
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
 * This file is part of the LibreOffice 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
#pragma once
11
12
#include <sal/types.h>
13
#include <vector>
14
15
namespace font
16
{
17
/** Font data container wraps binary content of a TTF font */
18
class FontDataContainer
19
{
20
    std::vector<sal_uInt8> const& mrFontBytes;
21
22
public:
23
    FontDataContainer(std::vector<sal_uInt8> const& rFontBytes)
24
782
        : mrFontBytes(rFontBytes)
25
782
    {
26
782
    }
27
28
2.03k
    const char* getPointer() const { return reinterpret_cast<const char*>(mrFontBytes.data()); }
29
30
4.66k
    size_t size() const { return mrFontBytes.size(); }
31
32
774
    std::vector<sal_uInt8>::const_iterator begin() const { return mrFontBytes.begin(); }
33
774
    std::vector<sal_uInt8>::const_iterator end() const { return mrFontBytes.end(); }
34
};
35
}
36
37
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */