+// etag.h - ETag subroutines header.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
+
#include <mutex>
#include <map>
#include <wx/wx.h>
#define ETAG_H
struct ETagData{
-
- wxString ETagValue;
- wxString ETagOrigValue;
- int ETagStatus;
-
+
+ wxString ETagValue;
+ wxString ETagOrigValue;
+ int ETagStatus;
+
};
class ETagDB{
public:
- //ETagDB(wxString AccountDir);
- ETagDB() {};
- ~ETagDB();
-
- // ETag functions.
-
- void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
- void RemoveETag(wxString Filename);
- void UpdateETag(wxString Filename, wxString ETag);
- void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
- std::map<wxString, wxString>* GetFilenamePointer();
- wxString GetETag(wxString Filename);
- wxString GetETagOriginal(wxString Filename);
- bool CheckETagExists(wxString Filename);
- //boost::mutex ProcessLock;
-
- // ETagDB functions.
-
- bool WriteETagDB();
- bool LoadETagDB();
- void DeleteETagDB();
- void SetupDB(wxString AccountDirFilename);
-
- bool GetWriteStatus();
- std::map<wxString, ETagData> GetETagData();
- //void *ProcessLock = new std::mutex;
-
+ //ETagDB(wxString AccountDir);
+ ETagDB() {};
+ ~ETagDB();
+
+ // ETag functions.
+
+ void AddETag(wxString Filename, wxString ETag, wxString ETagOriginal);
+ void RemoveETag(wxString Filename);
+ void UpdateETag(wxString Filename, wxString ETag);
+ void UpdateETag(wxString Filename, wxString ETag, wxString ETagOriginal);
+ std::map<wxString, wxString>* GetFilenamePointer();
+ wxString GetETag(wxString Filename);
+ wxString GetETagOriginal(wxString Filename);
+ bool CheckETagExists(wxString Filename);
+ bool ETagExists(wxString Filename);
+
+ // ETagDB functions.
+
+ bool WriteETagDB();
+ bool LoadETagDB();
+ void DeleteETagDB();
+ void SetupDB(wxString AccountDirFilename);
+
+ bool GetWriteStatus();
+ std::map<wxString, ETagData> GetETagData();
+ //void *ProcessLock = new std::mutex;
+
private:
- std::map<wxString, wxString> FilenameETag;
- std::map<wxString, wxString> FilenameETagOriginal;
- bool NeedsWrite = FALSE;
- bool MarkedDeleted = FALSE;
- wxString AccountDir;
- std::mutex *ProcessLock = new std::mutex();
+ std::map<wxString, wxString> FilenameETag;
+ std::map<wxString, wxString> FilenameETagOriginal;
+ bool NeedsWrite = FALSE;
+ bool MarkedDeleted = FALSE;
+ wxString AccountDir;
+ std::mutex *ProcessLock = new std::mutex();
};
/*
-class ETagDB2{
-public:
+ class ETagDB2{
+ public:
ETagDB2() {} ;
~ETagDB2() {};
void DeleteETagDB();
bool GetWriteStatus();
-private:
+ private:
std::map<wxString, wxString> FilenameETag;
std::map<wxString, wxString> FilenameETagOriginal;
bool NeedsWrite = FALSE;
bool MarkedDeleted = FALSE;
- /*
std::mutex ProcessLock;
wxString AccountDir;
-};
-*/
+ };
+ */
#endif
\ No newline at end of file