createdb.h 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* This file is part of the Chakra project

   Copyright (C) 2010 Dario Freddi <drf@chakra-project.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.
*/

#ifndef CREATEDB_H
#define CREATEDB_H

#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
17
#include <QtCore/QHash>
18
#include <sqlite3.h>
19 20 21 22 23 24 25 26 27 28 29 30 31

class CreateDb : public QObject
{
    Q_OBJECT
    public:
        CreateDb(const QString &db, const QStringList &targets, QObject* parent = 0);
        virtual ~CreateDb();

    public slots:
        void start();

    private:
        QString cleanPath(const QString &path);
Dario Freddi's avatar
Dario Freddi committed
32
        bool writeArchive(const QString &filename, const QHash<QString,QString> &files);
33 34 35 36 37 38 39 40 41

    private:
        QString m_db;
        QStringList m_targets;
        QTextStream out;
        QTextStream in;
};

#endif // CREATEDB_H