#ifndef TITAN_PCBCAM_GERBER274XPARSER_H
#define TITAN_PCBCAM_GERBER274XPARSER_H
#include "../titanpcbcamglobal.h"
#include "odbfeatureparser.h"

class QIODevice;

class PcbCamGerber274XParserPrivate;
class TITAN_PCBCAM_EXPORT PcbCamGerber274XParser
{
public:

    struct ApertureInfo {
        explicit ApertureInfo(){}
        int dcode {0};
        QString name;
        bool isStandard {true};
        QList<PcbCamOdbFeatureInfo> features;
    };


    enum class Cmd {
        COORD = 0,
        APERTURE_SELECT = 1,
        FS,
        MO,
        LP,
        AD_CIRCLE,
        AD_RECT,
        AD_OBROUND,
        AD_POLY,
        AD_MACRO,
        AM,
        IF,
        REGION_MODE,
        QUAD_MODE,
        SR,

        // 以下为旧版格式命令
        AS,
        INN,
        IP,
        IR,
        IO,
        MI,
        OF,
        SF,
        LN,
        DEPRECATED_UNIT,
        DEPRECATED_FORMAT,

        UNKNOW ,
        EMPTY
    };



    explicit PcbCamGerber274XParser();
    ~PcbCamGerber274XParser();

    void parse(QIODevice *iIODevice);

    QList<PcbCamOdbFeatureInfo> features() const;
    QList<ApertureInfo> apertures() const;

protected:
    const QScopedPointer<PcbCamGerber274XParserPrivate> d_ptr;

private:
    Q_DECLARE_PRIVATE(PcbCamGerber274XParser)
    Q_DISABLE_COPY(PcbCamGerber274XParser)
};


#endif // TITAN_PCBCAM_GERBER274XPARSER_H
