#ifndef DIRPARSERTHREAD_H
#define DIRPARSERTHREAD_H
#include "GlobalDefine.h"
#include <QDir>
#include <QReadWriteLock>
#include "TrainLogFileMgr.h"

class CDirParserThread : public QObject
{
 Q_OBJECT
public:
    CDirParserThread();
    void SetParsingInfo(QDir dir,QString Filter,bool KeepData = false);
    void KillThread();
    int ParseDir(QDir dir, bool KeepData = false);

private:
    QDir mRootDir;
    bool mKeepData;
    QReadWriteLock mMutex;
    bool mExecThread;
    QString mFilter;

public slots:
    void ParseDirectories();

signals:
    void NewLogParsed(QString,bool);
    void NewLogParsed(CLogElement*);
    void ParsingFinished(int);
    void EmptyDirParsed();
};

#endif // DIRPARSERTHREAD_H
