File: tst_abstractregexp.h

package info (click to toggle)
valentina 0.6.1~dfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 318,436 kB
  • sloc: cpp: 158,862; sh: 243; python: 219; makefile: 101; xml: 93
file content (68 lines) | stat: -rw-r--r-- 2,139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/************************************************************************
 **
 **  @file
 **  @author Roman Telezhynskyi <dismine(at)gmail.com>
 **  @date   25 10, 2016
 **
 **  @brief
 **  @copyright
 **  This source code is part of the Valentina project, a pattern making
 **  program, whose allow create and modeling patterns of clothing.
 **  Copyright (C) 2016 Valentina project
 **  <https://bitbucket.org/dismine/valentina> All Rights Reserved.
 **
 **  Valentina is free software: you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License as published by
 **  the Free Software Foundation, either version 3 of the License, or
 **  (at your option) any later version.
 **
 **  Valentina is distributed in the hope that it will be useful,
 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 **  GNU General Public License for more details.
 **
 **  You should have received a copy of the GNU General Public License
 **  along with Valentina.  If not, see <http://www.gnu.org/licenses/>.
 **
 *************************************************************************/

#ifndef TST_ABSTRACTREGEXP_H
#define TST_ABSTRACTREGEXP_H

#include "../vtest/abstracttest.h"

#include <QPointer>

class QTranslator;
class VTranslateVars;

class TST_AbstractRegExp : public AbstractTest
{
    Q_OBJECT
public:
    TST_AbstractRegExp(const QString &locale, QObject *parent = nullptr);
    virtual ~TST_AbstractRegExp();

protected:
    QString m_locale;
    QPointer<QTranslator> m_vTranslator;
    VTranslateVars *m_trMs;

    virtual void        PrepareData()=0;
    virtual QStringList AllNames()=0;

    int  LoadVariables(const QString &checkedLocale);
    void RemoveTrVariables(const QString &checkedLocale);
    void InitTrMs();

    void CallTestCheckNoEndLine();
    void CallTestCheckRegExpNames();
    void CallTestCheckIsNamesUnique();
    void CallTestCheckNoOriginalNamesInTranslation();
    void CallTestForValidCharacters();

private:
    Q_DISABLE_COPY(TST_AbstractRegExp)
};

#endif // TST_ABSTRACTREGEXP_H