
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <regex.h>
#include <libpq-fe.h>

#include <string>
#include <vector>
#include <fstream>
using namespace std;

#define DATA_DIR "/clair/bklimt/web/www/perception/working/data/"

class Photo {
	public:
		Photo();
		Photo(int id, string url, time_t timestamp, vector<string> keywords);
		Photo(const Photo& other);
		Photo operator=(const Photo& other);

		void setFaceID(int face_id);

		int getID();
		string getURL();
		time_t getTimeStamp();
		vector<string> getKeywords();
		string getFileName();
		int getFaceID();
		int getFaceCount();
		int getFaceID(int i);

		bool hasKeyword(string keyword);
	private:
		int id;
		vector<string> keywords;
		string url;
		time_t timestamp;
		string filename;
		int face_id;
		int face_count;
		vector<int> face_ids;
};

#ifdef DECLARE_PHOTOS
vector<Photo> photos;
#else
extern vector<Photo> photos;
#endif

void loadPhotos();

