OSDN Git Service

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