Open-Typer
Open source typewriting tutor program
Loading...
Searching...
No Matches
HistoryParser Class Reference

The HistoryParser class provides functions for exercise history and statistics. More...

#include "history/internal/HistoryParser.h"

Inheritance diagram for HistoryParser:
Collaboration diagram for HistoryParser:

Signals

void lessonPackChanged (QString value)
 
void lessonChanged (int value)
 
void sublessonChanged (int value)
 
void exerciseChanged (int value)
 
void countChanged (int value)
 

Public Member Functions

QString lessonPack (void)
 
void setLessonPack (QString value)
 
int lesson (void)
 
void setLesson (int value)
 
int sublesson (void)
 
void setSublesson (int value)
 
int exercise (void)
 
void setExercise (int value)
 
int count (void)
 
Q_INVOKABLE HistoryEntry at (int index)
 
Q_INVOKABLE void append (HistoryEntry entry)
 
Q_INVOKABLE void append (int grossHitsPerMinute, int mistakes, int timeSecs)
 

Properties

QString lessonPack
 
int lesson
 
int sublesson
 
int exercise
 
int count
 

Static Private Member Functions

static QJsonDocument historyDocument (void)
 
static QJsonValue historyPackValue (QString pack)
 

Private Attributes

QString m_lessonPack
 
int m_lesson = 0
 
int m_sublesson = 0
 
int m_exercise = 0
 

Static Private Attributes

static const QString historyFile = "/history.json"
 
static const QString speedProperty = "speed"
 
static const QString mistakesProperty = "mistakes"
 
static const QString timeProperty = "time"
 

Detailed Description

The HistoryParser class provides functions for exercise history and statistics.

Member Function Documentation

◆ append()

void HistoryParser::append ( int  grossHitsPerMinute,
int  mistakes,
int  timeSecs 
)

Adds a new entry to the exercise history.

◆ at()

HistoryEntry HistoryParser::at ( int  index)

Returns an entry of the exercise history.

◆ historyDocument()

QJsonDocument HistoryParser::historyDocument ( void  )
staticprivate

Returns JSON document of the history JSON file.

◆ historyPackValue()

QJsonValue HistoryParser::historyPackValue ( QString  pack)
staticprivate

Returns JSON value of the pack history.

Property Documentation

◆ count

int HistoryParser::count
read

Number of entries in the exercise history.

◆ exercise

int HistoryParser::exercise
readwrite

Current exercise

◆ lesson

int HistoryParser::lesson
readwrite

Current lesson

◆ lessonPack

QString HistoryParser::lessonPack
readwrite

Current lesson pack raw name.

See also
BuiltInPacks

◆ sublesson

int HistoryParser::sublesson
readwrite

Current sublesson


The documentation for this class was generated from the following files: