Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial import of code already done for Xestia Address Book
[xestiaab/.git] / source / common / etag.h
1 #include <mutex>
2 #include <map>
3 #include <wx/wx.h>
4 #include <wx/textfile.h>
5 #include <wx/filefn.h>
6 #include <wx/tokenzr.h>
7 #include <SFML/System/Lock.hpp>
9 #ifndef ETAG_H
10 #define ETAG_H
12 struct ETagData{
14         wxString ETagValue;
15         wxString ETagOrigValue;
16         int ETagStatus;
18 };
20 class ETagDB{
21 public:
22         //ETagDB(wxString AccountDir);
23         ETagDB() {};
24         ~ETagDB();
26         // ETag functions.
27         
28         void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
29         void RemoveETag(wxString Filename);
30         void UpdateETag(wxString Filename, wxString ETag);
31         void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
32         std::map<wxString, wxString>* GetFilenamePointer();
33         wxString GetETag(wxString Filename);
34         wxString GetETagOriginal(wxString Filename);
35         bool CheckETagExists(wxString Filename);
36         //boost::mutex ProcessLock;
37         
38         // ETagDB functions.
39         
40         bool WriteETagDB();
41         bool LoadETagDB();
42         void DeleteETagDB();
43         void SetupDB(wxString AccountDirFilename);
44         
45         bool GetWriteStatus();
46         std::map<wxString, ETagData> GetETagData();
47         //void *ProcessLock = new std::mutex;
49 private:
50         std::map<wxString, wxString> FilenameETag;
51         std::map<wxString, wxString> FilenameETagOriginal;
52         bool NeedsWrite = FALSE;
53         bool MarkedDeleted = FALSE;
54         wxString AccountDir;
55         std::mutex *ProcessLock = new std::mutex();     
56 };
58 /*
59 class ETagDB2{
60 public:
61         ETagDB2() {} ;
62         ~ETagDB2() {};
63         
64         // ETag functions.
65         
66         void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
67         void RemoveETag(wxString Filename);
68         void UpdateETag(wxString Filename, wxString ETag);
69         void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
70         wxString GetETag(wxString Filename);
71         wxString GetETagOriginal(wxString Filename);
72         
73         // ETagDB functions.
74         
75         bool WriteETagDB();
76         bool LoadETagDB();
77         void DeleteETagDB();
78         
79         bool GetWriteStatus();
80 private:
81         std::map<wxString, wxString> FilenameETag;
82         std::map<wxString, wxString> FilenameETagOriginal;
83         bool NeedsWrite = FALSE;
84         bool MarkedDeleted = FALSE;
85         /*
86         std::mutex ProcessLock;
87         wxString AccountDir;
88 };
89 */
92 #endif
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy