Cutelee
6.1.0
templates
i18n
l10n_filesize.h
1
/*
2
* This file is part of the Cutelee template system.
3
*
4
* Copyright (c) 2020 Matthias Fehring <mf@huessenbergnetz.de>
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either version
9
* 2 of the Licence, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Library General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef L10N_FILESIZE_H
21
#define L10N_FILESIZE_H
22
23
#include "node.h"
24
25
namespace
Cutelee
26
{
27
class
Parser
;
28
}
29
30
using namespace
Cutelee
;
31
32
class
L10nFileSizeNodeFactory
:
public
AbstractNodeFactory
33
{
34
Q_OBJECT
35
public
:
36
L10nFileSizeNodeFactory
();
37
38
Node
*getNode(
const
QString
&tagContent,
Parser
*p)
const override
;
39
};
40
41
class
L10nFileSizeVarNodeFactory
:
public
AbstractNodeFactory
42
{
43
Q_OBJECT
44
public
:
45
L10nFileSizeVarNodeFactory
();
46
47
Node
*getNode(
const
QString
&tagContent,
Parser
*p)
const override
;
48
};
49
50
class
L10nFileSizeNode
:
public
Node
51
{
52
Q_OBJECT
53
public
:
54
L10nFileSizeNode
(
const
FilterExpression
&size,
55
const
FilterExpression
&unitSystem,
56
const
FilterExpression
&precision,
57
const
FilterExpression
&multiplier,
58
QObject *parent =
nullptr
);
59
60
void
render(
OutputStream
*stream,
Context
*c)
const override
;
61
62
private
:
63
FilterExpression
m_size;
64
FilterExpression
m_unitSystem;
65
FilterExpression
m_precision;
66
FilterExpression
m_multiplier;
67
};
68
69
class
L10nFileSizeVarNode
:
public
Node
70
{
71
Q_OBJECT
72
public
:
73
L10nFileSizeVarNode
(
const
FilterExpression
&size,
74
const
FilterExpression
&unitSystem,
75
const
FilterExpression
&precision,
76
const
FilterExpression
&multiplier,
77
const
QString
&resultName,
78
QObject *parent =
nullptr
);
79
80
void
render(
OutputStream
*stream,
Context
*c)
const override
;
81
82
private
:
83
FilterExpression
m_size;
84
FilterExpression
m_unitSystem;
85
FilterExpression
m_precision;
86
FilterExpression
m_multiplier;
87
QString
m_resultName;
88
};
89
90
#endif
Cutelee::AbstractNodeFactory
Base class for all NodeFactories.
Definition:
node.h:300
Cutelee::Context
The Context class holds the context to render a Template with.
Definition:
context.h:119
Cutelee::FilterExpression
A FilterExpression object represents a filter expression in a template.
Definition:
filterexpression.h:120
Cutelee::Node
Base class for all nodes.
Definition:
node.h:78
Cutelee::OutputStream
The OutputStream class is used to render templates to a QTextStream.
Definition:
outputstream.h:81
Cutelee::Parser
The Parser class processes a string template into a tree of nodes.
Definition:
parser.h:49
L10nFileSizeNodeFactory
Definition:
l10n_filesize.h:33
L10nFileSizeNode
Definition:
l10n_filesize.h:51
L10nFileSizeVarNodeFactory
Definition:
l10n_filesize.h:42
L10nFileSizeVarNode
Definition:
l10n_filesize.h:70
QString
Definition:
operatorcasttests.cpp:24
Cutelee
The Cutelee namespace holds all public Cutelee API.
Definition:
Mainpage.dox:8
Generated by
1.9.1