// 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 #include #include #include #include #include #include #include #ifndef ETAG_H #define ETAG_H struct ETagData{ 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* 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 GetETagData(); //void *ProcessLock = new std::mutex; private: std::map FilenameETag; std::map FilenameETagOriginal; bool NeedsWrite = FALSE; bool MarkedDeleted = FALSE; wxString AccountDir; std::mutex *ProcessLock = new std::mutex(); }; /* class ETagDB2{ public: ETagDB2() {} ; ~ETagDB2() {}; // 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); wxString GetETag(wxString Filename); wxString GetETagOriginal(wxString Filename); // ETagDB functions. bool WriteETagDB(); bool LoadETagDB(); void DeleteETagDB(); bool GetWriteStatus(); private: std::map FilenameETag; std::map FilenameETagOriginal; bool NeedsWrite = FALSE; bool MarkedDeleted = FALSE; std::mutex ProcessLock; wxString AccountDir; }; */ #endif