Learn Environment
Public Member Functions | List of all members
TaskParser Class Reference

Parses tasks and subtasks from a JSON file. More...

#include <task_parser.hpp>

Collaboration diagram for TaskParser:
Collaboration graph

Public Member Functions

QVector< QSharedPointer< Task > > loadTasks (const QString &taskPath, const QString &difficultyPath, const QString &topicPath)
 Loads tasks with all configuration JSON files. More...
 

Detailed Description

Parses tasks and subtasks from a JSON file.

The TaskParser class is responsible for loading tasks and their subtasks from a JSON file. It provides methods to parse the JSON data and convert it into Task and Subtask objects.

Member Function Documentation

◆ loadTasks()

QVector< QSharedPointer< Task > > TaskParser::loadTasks ( const QString &  taskPath,
const QString &  difficultyPath,
const QString &  topicPath 
)

Loads tasks with all configuration JSON files.

This function reads the tasks, difficulty levels, and topic definitions from the specified JSON files. It parses the JSON data and constructs a vector of shared pointers to Task objects. The tasks are sorted based on the defined topic order from the topic definition JSON file. If any of the files cannot be opened or if there is a JSON parsing error, an empty vector is returned.

Parameters
taskPathThe path to the JSON file containing the tasks.
difficultyPathThe path to the JSON file containing the difficulty levels.
topicPathThe path to the JSON file containing the topic definitions.
Returns
A vector of shared pointers to the loaded tasks.
Here is the caller graph for this function:

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