+ // Get the list of previously backed up files from the database.
+ sqlite3 *db;
+
+ const char *dbname = "test.db";
+ int rc = sqlite3_open( dbname, &db );
+ if( SQLITE_OK != rc ) {
+ cerr << "Cannot open database: " << dbname << ". Error message is..." << endl;
+ cerr << sqlite3_errmsg(db) << endl;
+ }
+
+ char *sqliteErrMsg = 0;
+ file_set previous_files;
+ rc = sqlite3_exec( db, "select * from filedata;", populate_set, &previous_files, &sqliteErrMsg );
+ if( SQLITE_OK != rc ) {
+ cerr << "Problem with database. Message is..." << endl;
+ cerr << sqliteErrMsg << endl;
+ }
+
+ sqlite3_close( db );
+
+ for( file_set::iterator i = previous_files.begin(); i != previous_files.end(); ++i ) {
+ cout << (*i)->getFileName() << endl;
+ }