Coverage Report

Created: 2025-12-31 10:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/vcl/font/FeatureParser.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
#ifndef INCLUDED_VCL_FONT_FEATUREPASER_HXX
11
#define INCLUDED_VCL_FONT_FEATUREPASER_HXX
12
13
#include <vcl/dllapi.h>
14
#include <rtl/ustring.hxx>
15
#include <vector>
16
#include <unordered_map>
17
18
#include <vcl/font/Feature.hxx>
19
20
namespace vcl::font
21
{
22
// These must not conflict with font name lists which use ; and ,
23
constexpr const char FeaturePrefix = ':';
24
constexpr const char FeatureSeparator = '&';
25
26
VCL_DLLPUBLIC OUString trimFontNameFeatures(OUString const& rFontName);
27
28
class VCL_DLLPUBLIC FeatureParser
29
{
30
private:
31
    OUString m_sLanguage;
32
    std::vector<FeatureSetting> m_aFeatures;
33
34
public:
35
    FeatureParser(std::u16string_view sFontName);
36
37
21.1M
    OUString const& getLanguage() const { return m_sLanguage; }
38
39
21.1M
    std::vector<FeatureSetting> const& getFeatures() const { return m_aFeatures; }
40
41
    std::unordered_map<uint32_t, int32_t> getFeaturesMap() const;
42
};
43
44
} // namespace vcl::font
45
46
#endif // INCLUDED_VCL_FONT_FEATUREPASER_HXX
47
48
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */