Add double click to view patch at patch list ctrl
[TortoiseGit.git] / src / TGitCache / StatusCacheEntry.h
blobf453087afa72a6e70c10d6fa79d0566b810a5c9f
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // External Cache Copyright (C) 2005 - 2006 - Will Dean, Stefan Kueng
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
21 struct TSVNCacheResponse;
22 #define CACHETIMEOUT 0x7FFFFFFF
23 extern DWORD cachetimeout;
25 #include "CacheInterface.h"
27 /**
28 * \ingroup TSVNCache
29 * Holds all the status data of one file or folder.
31 class CStatusCacheEntry
33 public:
34 CStatusCacheEntry();
35 CStatusCacheEntry(const git_wc_status2_t* pGitStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil = 0);
36 bool HasExpired(long now) const;
37 void BuildCacheResponse(TSVNCacheResponse& response, DWORD& responseLength) const;
38 bool IsVersioned() const;
39 bool DoesFileTimeMatch(__int64 testTime) const;
40 bool ForceStatus(git_wc_status_kind forcedStatus);
41 git_wc_status_kind GetEffectiveStatus() const { return m_highestPriorityLocalStatus; }
42 bool IsKindKnown() const { return ((m_kind != git_node_none)&&(m_kind != git_node_unknown)); }
43 void SetStatus(const git_wc_status2_t* pGitStatus);
44 bool HasBeenSet() const;
45 void Invalidate();
46 bool IsDirectory() const { return ((m_kind == git_node_dir)&&(m_highestPriorityLocalStatus != git_wc_status_ignored)); }
47 bool SaveToDisk(FILE * pFile);
48 bool LoadFromDisk(FILE * pFile);
49 void SetKind(git_node_kind_t kind) {m_kind = kind;}
50 private:
51 void SetAsUnversioned();
53 private:
54 long m_discardAtTime;
55 git_wc_status_kind m_highestPriorityLocalStatus;
56 git_wc_status2_t m_GitStatus;
57 __int64 m_lastWriteTime;
58 bool m_bSet;
59 git_node_kind_t m_kind;
60 bool m_bReadOnly;
62 // Values copied from the 'entries' structure
63 bool m_bSVNEntryFieldSet;
64 CStringA m_sUrl;
65 CStringA m_sOwner;
66 CStringA m_sAuthor;
67 CStringA m_sPresentProps;
68 git_revnum_t m_commitRevision;
70 friend class CGitStatusCache;