Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
f68929c9a46c5d50a44b220c68e792daa22e060b
[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     //boost::mutex ProcessLock;
56     
57     // ETagDB functions.
58     
59     bool WriteETagDB();
60     bool LoadETagDB();
61     void DeleteETagDB();
62     void SetupDB(wxString AccountDirFilename);
63     
64     bool GetWriteStatus();
65     std::map<wxString, ETagData> GetETagData();
66     //void *ProcessLock = new std::mutex;
67     
68 private:
69     std::map<wxString, wxString> FilenameETag;
70     std::map<wxString, wxString> FilenameETagOriginal;
71     bool NeedsWrite = FALSE;
72     bool MarkedDeleted = FALSE;
73     wxString AccountDir;
74     std::mutex *ProcessLock = new std::mutex();
75 };
77 /*
78  class ETagDB2{
79  public:
80         ETagDB2() {} ;
81         ~ETagDB2() {};
82         
83         // ETag functions.
84         
85         void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
86         void RemoveETag(wxString Filename);
87         void UpdateETag(wxString Filename, wxString ETag);
88         void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
89         wxString GetETag(wxString Filename);
90         wxString GetETagOriginal(wxString Filename);
91         
92         // ETagDB functions.
93         
94         bool WriteETagDB();
95         bool LoadETagDB();
96         void DeleteETagDB();
97         
98         bool GetWriteStatus();
99  private:
100         std::map<wxString, wxString> FilenameETag;
101         std::map<wxString, wxString> FilenameETagOriginal;
102         bool NeedsWrite = FALSE;
103         bool MarkedDeleted = FALSE;
104         std::mutex ProcessLock;
105         wxString AccountDir;
106  };
107  */
110 #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