-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordprocessor.h
More file actions
94 lines (74 loc) · 1.82 KB
/
wordprocessor.h
File metadata and controls
94 lines (74 loc) · 1.82 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef WORDPROCESSOR_H
#define WORDPROCESSOR_H
#include <QString>
#include <vector>
#include <QStringList>
#include <QMap>
class wordProcessor
{
public:
wordProcessor();
bool checkAnswer(QString string);
int goodAnswer() const;
void setGoodAnswer(int goodAnswer);
int badAnswer() const;
void setBadAnswer(int badAnswer);
QString getNewWord();
int getAskedIndex() const;
void init();
int getAllWords() const;
QStringList getPrevAnswer() const;
QStringList getAnswer(int arrayIndex) const;
bool openFile(QString fileName);
bool saveFile(QString fileName, bool append = false);
/*!
* \brief switchLanguage switch language
*/
void switchLanguage();
/*!
* \brief getSwitch witch language going to used
* \return
*/
bool getSwitch();
bool getWrongAnswersOnly(bool append = false);
int getWrongWordsSize()
{
return _wrongWords.size();
}
private:
/***
* QVector<QStringList> matrix{{"foo", "bar", "baz"}, {"hello", "world", "!"}};
*
* qDebug() << "output: " << matrix[0];
* //Will output : output: ("foo", "bar", "baz")
*
* qDebug() << "output: " << matrix[0][1];
* //Will output : "bar"
*
**/
/*!
* \brief _words contains English - Hungarian words
*/
std::vector<QStringList> _words;
std::vector<QStringList> _wrongWords;
//std::vector<QStringList> _correctWords;
QStringList _prevAnswer;
int _goodAnswer;
int _badAnswer;
int _askedIndex;
int _actualIndex;
int _allWords;
/*!
* \brief _switched witch language going to used
*/
int _switched;
enum Separate
{
TABULATOR = 0,
OLDWAY,
COLON,
EQUAL
};
QMap<Separate, QString> _separate;
};
#endif // WORDPROCESSOR_H