[go: up one dir, main page]

Menu

[18dfac]: / drillbit / lib / LyDict.h  Maximize  Restore  History

Download this file

58 lines (41 with data), 1.2 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
#ifndef LYDICT_H
#define LYDICT_H
#include <QtCore>
#include "LyWord.h"
/**
* @brief
* A list (dictionary) of @ref LyWord "LyWords" that is capable of file
* loading and saving.
* @author Gregory McQuillan
*/
class LyDict
{
public:
LyDict(void);
// ~LyDict(void);
void load(const QString&);
void save(const QString&);
// Mutators
void setName(const QString&);
void add(const LyWord&);
void add(const QString &,
const QChar&,
const QString &);
void add(const QString &,
const char&,
const QString &);
void removeAt(const int&);
// Accessors
QString name(void);
LyWord *itemAt(const int&);
const int count(void) const;
// Misc
static QString posFromAbbr(QChar);
static QChar posFromName(QString);
private:
void load_file(const QString&); /** brains behind the public load() function */
void parse_line(QString); /** parses lines in the file load() function */
QString _name; /** the name of the dictionary */
QList<LyWord> _words;
};
#endif