56 static std::shared_ptr<ConfigParser> instance();
57 std::shared_ptr<IConfigParser> createInstance()
const override;
58 Q_INVOKABLE
bool open(
const QString fileName)
override;
59 Q_INVOKABLE
void loadToBuffer(
const QByteArray content)
override;
60 Q_INVOKABLE QByteArray data(
void)
override;
61 Q_INVOKABLE
bool bufferOpened(
void)
override;
62 Q_INVOKABLE
void close(
void)
override;
63 QString fileName(
void)
override;
64 Q_INVOKABLE
int lessonCount(
void)
override;
65 Q_INVOKABLE
int sublessonCount(
int lesson)
override;
66 Q_INVOKABLE
int exerciseCount(
int lesson,
int sublesson)
override;
67 Q_INVOKABLE
int exerciseLine(
int lesson,
int sublesson,
int exercise)
override;
68 Q_INVOKABLE
bool exerciseRepeatBool(
int lesson,
int sublesson,
int exercise)
override;
69 Q_INVOKABLE QString exerciseRepeatType(
int lesson,
int sublesson,
int exercise)
override;
70 Q_INVOKABLE
int exerciseRepeatLimit(
int lesson,
int sublesson,
int exercise)
override;
71 Q_INVOKABLE
int exerciseLineLength(
int lesson,
int sublesson,
int exercise)
override;
72 Q_INVOKABLE QString lessonDesc(
int lesson)
override;
73 Q_INVOKABLE QString parseDesc(QString desc)
override;
74 Q_INVOKABLE QString sublessonName(
int id)
override;
75 Q_INVOKABLE QString lessonTr(
int id)
override;
76 Q_INVOKABLE QString sublessonTr(
int id)
override;
77 Q_INVOKABLE QString exerciseTr(
int id)
override;
78 Q_INVOKABLE QString exerciseRawText(
int lesson,
int sublesson,
int exercise)
override;
79 Q_INVOKABLE QString exerciseText(
int lesson,
int sublesson,
int exercise)
override;
80 Q_INVOKABLE QString initExercise(QString exercise,
int lineLength)
override;
81 Q_INVOKABLE QString initExercise(QString exercise,
int lineLength,
bool lineCountLimit,
int currentLine)
override;
82 Q_INVOKABLE QString initText(QString rawText)
override;
83 Q_INVOKABLE
bool addExercise(
int lesson,
int sublesson,
int exercise,
bool repeat, QString repeatType,
int repeatLimit,
int lineLength, QString desc, QString rawText)
override;
84 Q_INVOKABLE
int defaultRepeatLimit(
void)
override;
85 Q_INVOKABLE
int defaultLineLength(
void)
override;
86 Q_INVOKABLE
void setCurrentLesson(
int value)
override;
87 Q_INVOKABLE
int currentLesson(
void)
override;
88 Q_INVOKABLE
void setCurrentSublesson(
int value)
override;
89 Q_INVOKABLE
int currentSublesson(
void)
override;
90 Q_INVOKABLE
void setCurrentExercise(
int value)
override;
91 Q_INVOKABLE
int currentExercise(
void)
override;
94 static std::shared_ptr<ConfigParser> m_instance;
97 QIODevice *currentDevice;
98 static const int m_defaultRepeatLimit = 128;
99 static const int m_defaultLineLength = 100;
100 bool reopen(QIODevice::OpenMode mode);
101 int exerciseID(
const QString line,
const int part);
102 QString lineOf(
int lesson,
int sublesson,
int exercise);
103 bool exerciseRepeatBool(
const QString config);
104 QString exerciseRepeatType(
const QString config);
105 QString exerciseRepeatConfig(
const QString line);
106 QString exerciseAttribute(
const QString config,
const int id);
107 QString exerciseAttributes(
const QString line);
108 QString exerciseRawText(
const QString line);
109 static QString generateText(QString rawText,
bool repeat, QString repeatType,
int repeatLimit);