MediaLibrary.cpp 436 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
#include "MediaLibrary.h"

MediaLibrary::MediaLibrary()
{
}

bool MediaLibrary::initialize(const std::string& dbPath)
{
    int res = sqlite3_open( dbPath.c_str(), &m_dbConnection );
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
10 11
    //FIXME:
    // PRAGMA foreign_keys = ON;
12 13 14 15 16 17 18 19 20 21 22 23 24
    return res == SQLITE_OK;
}


const std::vector<IFile*>&MediaLibrary::files()
{
    if ( m_files == NULL )
    {
        m_files = new std::vector<IFile*>();
        // magic
    }
    return *m_files;
}