Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / common / etag.h
1 // etag.h - ETag subroutines header.
2 //
3 // (c) 2012-2015 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
10 //
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <mutex>
20 #include <map>
21 #include <wx/wx.h>
22 #include <wx/textfile.h>
23 #include <wx/filefn.h>
24 #include <wx/tokenzr.h>
25 #include <SFML/System/Lock.hpp>
27 #ifndef ETAG_H
28 #define ETAG_H
30 struct ETagData{
31     
32     wxString ETagValue;
33     wxString ETagOrigValue;
34     int ETagStatus;
35     
36 };
38 class ETagDB{
39 public:
40     //ETagDB(wxString AccountDir);
41     ETagDB() {};
42     ~ETagDB();
43     
44     // ETag functions.
45     
46     void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
47     void RemoveETag(wxString Filename);
48     void UpdateETag(wxString Filename, wxString ETag);
49     void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
50     std::map<wxString, wxString>* GetFilenamePointer();
51     wxString GetETag(wxString Filename);
52     wxString GetETagOriginal(wxString Filename);
53     bool CheckETagExists(wxString Filename);
54     bool ETagExists(wxString Filename);
55     
56     // ETagDB functions.
57     
58     bool WriteETagDB();
59     bool LoadETagDB();
60     void DeleteETagDB();
61     void SetupDB(wxString AccountDirFilename);
62     
63     bool GetWriteStatus();
64     std::map<wxString, ETagData> GetETagData();
65     //void *ProcessLock = new std::mutex;
66     
67 private:
68     std::map<wxString, wxString> FilenameETag;
69     std::map<wxString, wxString> FilenameETagOriginal;
70     bool NeedsWrite = FALSE;
71     bool MarkedDeleted = FALSE;
72     wxString AccountDir;
73     std::mutex *ProcessLock = new std::mutex();
74 };
76 /*
77  class ETagDB2{
78  public:
79         ETagDB2() {} ;
80         ~ETagDB2() {};
81         
82         // ETag functions.
83         
84         void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
85         void RemoveETag(wxString Filename);
86         void UpdateETag(wxString Filename, wxString ETag);
87         void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
88         wxString GetETag(wxString Filename);
89         wxString GetETagOriginal(wxString Filename);
90         
91         // ETagDB functions.
92         
93         bool WriteETagDB();
94         bool LoadETagDB();
95         void DeleteETagDB();
96         
97         bool GetWriteStatus();
98  private:
99         std::map<wxString, wxString> FilenameETag;
100         std::map<wxString, wxString> FilenameETagOriginal;
101         bool NeedsWrite = FALSE;
102         bool MarkedDeleted = FALSE;
103         std::mutex ProcessLock;
104         wxString AccountDir;
105  };
106  */
109 #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