Label.h 648 Bytes
Newer Older
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
1 2 3 4 5 6 7
#ifndef LABEL_H
#define LABEL_H

#include <sqlite3.h>
#include <string>

#include "ILabel.h"
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
8
class File;
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
9 10 11 12 13

class Label : public ILabel
{
    public:
        Label(sqlite3* dbConnection, sqlite3_stmt* stmt);
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
14
        Label( const std::string& name );
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
15 16 17 18

    public:
        virtual const std::string& name();
        virtual std::vector<IFile*> files();
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
19
        bool insert( sqlite3* dbConnection );
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
20 21

        static bool createTable( sqlite3* dbConnection );
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
22
        bool link( File* file );
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
23 24 25 26 27 28 29 30
    private:
        sqlite3* m_dbConnection;
        unsigned int m_id;
        std::string m_name;
        std::vector<IFile*>* m_files;
};

#endif // LABEL_H