/****************************************************************************
**
** Copyright (C) 2012 - 2014 Jolla Ltd.
** Contact: http://jolla.com/
**
** This file is part of Qt Creator.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Digia.
**
****************************************************************************/

#ifndef NXTTARGETSXMLPARSER_H
#define NXTTARGETSXMLPARSER_H

#include <QMetaType>
#include <QObject>

namespace Utils { class FileName; }

namespace Nxt {

class NxtTargetData;
class NxtTargetsXmlReaderPrivate;
class NxtTargetsXmlReader : public QObject
{
public:
    NxtTargetsXmlReader(const QString &fileName, QObject *parent = nullptr);
    ~NxtTargetsXmlReader() override;

    bool hasError() const;
    QString errorString() const;

    QList<NxtTargetData> targetData() const;
    int version() const;

private:
    NxtTargetsXmlReaderPrivate *d;
};

class NxtTargetsXmlWriterPrivate;
class NxtTargetsXmlWriter : public QObject
{
public:
    NxtTargetsXmlWriter(const QString &fileName, int version,
                        const QList<NxtTargetData> &targetData, QObject *parent = nullptr);
    ~NxtTargetsXmlWriter() override;

    bool hasError() const;
    QString errorString() const;

private:
    NxtTargetsXmlWriterPrivate *d;
};

class NxtTargetData
{
public:
    void clear();

    QString name;
    QString gccDumpMachine;
    QString qmakeQuery;
};

} // namespace Nxt

Q_DECLARE_METATYPE(Nxt::NxtTargetData)

#endif // NXTTARGETSXMLPARSER_H
