Fix typos
[TortoiseGit.git] / src / TGitCache / StatusCacheEntry.h
blob7bd6fa854720875e311ec0e3448f1a587a21e971
1 // TortoiseGit - a Windows shell extension for easy version control
3 // External Cache Copyright (C) 2005 - 2006 - Will Dean, Stefan Kueng
4 // Copyright (C) 2008-2012, 2017, 2023 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program 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
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
22 struct TGITCacheResponse;
23 extern ULONGLONG cachetimeout;
25 #include "CacheInterface.h"
27 /**
28 * \ingroup TGitCache
29 * Holds all the status data of one file or folder.
31 class CStatusCacheEntry
33 public:
34 CStatusCacheEntry();
35 CStatusCacheEntry(const git_wc_status_kind status);
36 CStatusCacheEntry(const git_wc_status2_t* pGitStatus, __int64 lastWriteTime, LONGLONG validuntil = 0);
37 bool HasExpired(LONGLONG now) const;
38 void BuildCacheResponse(TGITCacheResponse& response, DWORD& responseLength) const;
39 bool IsVersioned() const;
40 bool DoesFileTimeMatch(__int64 testTime) const;
41 bool ForceStatus(git_wc_status_kind forcedStatus);
42 git_wc_status_kind GetEffectiveStatus() const { return m_highestPriorityLocalStatus; }
43 void SetStatus(const git_wc_status2_t* pGitStatus);
44 bool HasBeenSet() const;
45 void Invalidate();
46 bool SaveToDisk(FILE* pFile) const;
47 bool LoadFromDisk(FILE * pFile);
48 private:
49 void SetAsUnversioned();
51 private:
52 LONGLONG m_discardAtTime;
53 git_wc_status_kind m_highestPriorityLocalStatus = git_wc_status_none;
54 git_wc_status2_t m_GitStatus;
55 __int64 m_lastWriteTime = 0;
56 bool m_bSet = false;
57 bool m_bAssumeValid = false;
58 bool m_bSkipWorktree = false;
60 friend class CGitStatusCache;