Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
862 B
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2016 Laszlo Fazekas <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef CSV_READ_LINE_H_
#define CSV_READ_LINE_H_

#include <QString>
#include <QIODevice>
#include <QByteArray>

#include "csv_layer_record.h"

/* The .png file names are within 20 characters, only the layer
 * names can be longer. If the length exceeds this, it will be
 * truncated.
 */
#define CSV_FIELD_MAX 50

class CSVReadLine
{

public:
    CSVReadLine();
    ~CSVReadLine();

    int nextLine(QIODevice* io);
    QString nextField();
    void rewind();

private:

    QString splitNext(int* pos);
    bool setLayer(CSVLayerRecord* );
    bool readFrame(int* pos);
    bool finalize();
    int readImpl(QIODevice* io);

    char       m_separator;
    int        m_row;
    QByteArray m_linebuf;
    int        m_pos;
};

#endif