1 // etag.h - ETag subroutines header.
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
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.
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.
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/>
22 #include <wx/textfile.h>
23 #include <wx/filefn.h>
24 #include <wx/tokenzr.h>
25 #include <SFML/System/Lock.hpp>
33 wxString ETagOrigValue;
40 //ETagDB(wxString AccountDir);
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);
61 void SetupDB(wxString AccountDirFilename);
63 bool GetWriteStatus();
64 std::map<wxString, ETagData> GetETagData();
65 //void *ProcessLock = new std::mutex;
68 std::map<wxString, wxString> FilenameETag;
69 std::map<wxString, wxString> FilenameETagOriginal;
70 bool NeedsWrite = FALSE;
71 bool MarkedDeleted = FALSE;
73 std::mutex *ProcessLock = new std::mutex();
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);
97 bool GetWriteStatus();
99 std::map<wxString, wxString> FilenameETag;
100 std::map<wxString, wxString> FilenameETagOriginal;
101 bool NeedsWrite = FALSE;
102 bool MarkedDeleted = FALSE;
103 std::mutex ProcessLock;