Implement commands to (un)block paths from getting crawled
[TortoiseGit.git] / src / TGitCache / StatusCacheEntry.h
blob69919e38a30a0f7be16a379f561ee2c1597367dc
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-2011 - 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 #define CACHETIMEOUT 0x7FFFFFFF
24 extern DWORD cachetimeout;
26 #include "CacheInterface.h"
28 /**
29 * \ingroup TSVNCache
30 * Holds all the status data of one file or folder.
32 class CStatusCacheEntry
34 public:
35 CStatusCacheEntry();
36 CStatusCacheEntry(const git_wc_status_kind status);
37 CStatusCacheEntry(const git_wc_status2_t* pGitStatus, __int64 lastWriteTime, bool bReadOnly, DWORD validuntil = 0);
38 bool HasExpired(long now) const;
39 void BuildCacheResponse(TGITCacheResponse& response, DWORD& responseLength) const;
40 bool IsVersioned() const;
41 bool DoesFileTimeMatch(__int64 testTime) const;
42 bool ForceStatus(git_wc_status_kind forcedStatus);
43 git_wc_status_kind GetEffectiveStatus() const { return m_highestPriorityLocalStatus; }
44 bool IsKindKnown() const { return ((m_kind != git_node_none)&&(m_kind != git_node_unknown)); }
45 void SetStatus(const git_wc_status2_t* pGitStatus);
46 bool HasBeenSet() const;
47 void Invalidate();
48 bool IsDirectory() const { return ((m_kind == git_node_dir)&&(m_highestPriorityLocalStatus != git_wc_status_ignored)); }
49 bool SaveToDisk(FILE * pFile);
50 bool LoadFromDisk(FILE * pFile);
51 void SetKind(git_node_kind_t kind) {m_kind = kind;}
52 private:
53 void SetAsUnversioned();
55 private:
56 long m_discardAtTime;
57 git_wc_status_kind m_highestPriorityLocalStatus;
58 git_wc_status2_t m_GitStatus;
59 __int64 m_lastWriteTime;
60 bool m_bSet;
61 git_node_kind_t m_kind;
62 bool m_bReadOnly;
64 // Values copied from the 'entries' structure
65 bool m_bSVNEntryFieldSet;
66 CStringA m_sUrl;
67 CStringA m_sOwner;
68 CStringA m_sAuthor;
69 CStringA m_sPresentProps;
70 git_revnum_t m_commitRevision;
72 friend class CGitStatusCache;