#ifndef SNAPSHOT_CLASS_H_INCLUDED
#define SNAPSHOT_CLASS_H_INCLUDED
#include <map>
#include <string>
#include "t_extra.h"
#include <memory>
using namespace std;
typedef unsigned long long ID_T;
typedef unsigned long long ULL;
/**
* File structure:
*
* 0 ID
* 1 Date
*
* 2 [list of paths...]
*/
#define SNAPSHOT_FILE_EXTENSION ".snap"
#define SNAPSHOT_FOLDER "Snapshots"
struct basic_snap_data{
string date = "";
string path = "";
ID_T id = 0;
};
/* prototype declared here for use in other .cpp files...*/
map<unsigned int, basic_snap_data> get_snapshot_info();
/* The snapshot_class will take a filename as an argument.
If not given one, it will create a new snapshot.*/
class snapshot_class{
public:
//constructors/destructors
snapshot_class(const string&);
snapshot_class(const char*);
snapshot_class();
snapshot_class(const char&); //for memory management purposes...
~snapshot_class();
//public functions
ID_T gid();
string gdate();
map<unsigned int, string> gsnap();
void del();
void clear();
private:
//variables
string filename = string();
string date = chrono_date().asc_time;
ID_T id = 0;
shared_ptr<map<unsigned int, string>> snapshot;
//functions
void constructor_tasks(const string&);
void load_snapshot(const string&);
};
#endif