#ifndef NxtDeployParser_H
#define NxtDeployParser_H

#include <projectexplorer/ioutputparser.h>

#include <QRegularExpression>
#include <QStringList>

namespace Nxt {
namespace Internal {

class NxtDeployParser : public ProjectExplorer::IOutputParser
{
    Q_OBJECT

public:
    explicit NxtDeployParser();

    void stdOutput(const QString &line) override;
    void stdError(const QString &line) override;

    void setWorkingDirectory(const QString &workingDirectory) override;

    QStringList searchDirectories() const;

    bool hasFatalErrors() const override;

    void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skippedLines) override;

private:
    void addDirectory(const QString &dir);
    void removeDirectory(const QString &dir);

    QRegularExpression m_error;
    QRegularExpression m_warning;

    QStringList m_directories;

    bool m_suppressIssues = false;

    int m_fatalErrorCount = 0;
};

} // namespace Internal
} // namespace Nxt


#endif // NxtDeployParser_H
