<commit_before><commit_msg>Added serialization and deserialization for project.<commit_after>#ifndef CLASSIFIERTRAINERPROJECT_H
#define CLASSIFIERTRAINERPROJECT_H

#include "QList"
#include "QMultiMap"
#include "Section.h"

class QStringList;
class QRect;
class QString;

class ClassifierTrainerProject
{

public:
    ClassifierTrainerProject(QString projectDirectory);
    ~ClassifierTrainerProject();

    QString* name();
    QString* description();
    QString* author();
    QString* type();

    QMultiMap<QString, Section>* positives();
    QList<QString>* negatives();

    bool addPositiveImage(QString pathToPositiveImage);
    bool addNegativeImage(QString pathToNegativeImage);
    bool removePositiveImage(QString pathToPositiveImage);
    bool removeNegativeImage(QString pathToNegativeImage);

    bool addSectionToPositiveImage(QString positiveImagePath, QRect section);
    bool removeSectionFromPositiveImage(QString positiveImagePath, QRect section);

    bool save();
    bool load();
    bool hasErrors();

    void appendToErrors(QString msg);
    QStringList* errors() const;

    static int projectVersionNumber() { return 1; }
    static QString projectType() { return QString("Cascade Classifier Trainer"); }

private:
    QString m_projectDirectory;         // path where the project is found
    QString m_projectConfigFilePath;    // path where the configuration file in the project is found

    QString* m_projectName;
    QString* m_projectDescription;
    QString* m_projectAuthor;
    QString* m_projectType;

    QMultiMap<QString, Section>* m_positives;
    QList<QString>* m_negatives;

    QStringList *m_errors;

    void determine_path_to_config_file(QString projectPath);

};

#endif // CLASSIFIERTRAINERPROJECT_H
{'fraction_non_alphanumeric': 0.08209806157354618, 'fraction_numerical': 0.0005701254275940707, 'mean_word_length': 4.909090909090909, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6798246', 'n_tokens_mistral': 516, 'n_tokens_neox': 500, 'n_words': 127}