Initialize members
[TortoiseGit.git] / src / TGitCache / CacheInterface.h
blob3dfeb67e70121b14a9a024d1d81f4b79a3e3575f
1 // TortoiseGit - a Windows shell extension for easy version control
3 // External Cache Copyright (C) 2005-2006,2008-2010 - TortoiseSVN
4 // Copyright (C) 2008-2013 - 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.
21 #pragma once
22 #include <wininet.h>
23 #include "GitStatus.h"
25 // The name of the named-pipe for the cache
27 #define TGIT_CACHE_PIPE_NAME _T("\\\\.\\pipe\\TGitCache")
28 #define TGIT_CACHE_COMMANDPIPE_NAME _T("\\\\.\\pipe\\TGitCacheCommand")
29 #define TGIT_CACHE_WINDOW_NAME _T("TGitCacheWindow")
30 #define TGIT_CACHE_MUTEX_NAME _T("TGitCacheMutex")
33 CString GetCachePipeName();
34 CString GetCacheCommandPipeName();
35 CString GetCacheMutexName();
37 CString GetCacheID();
38 bool SendCacheCommand(BYTE command, const WCHAR * path = NULL);
40 typedef enum git_node_kind_t
42 git_node_none,
43 git_node_file,
44 git_node_dir,
45 git_node_unknown,
47 }git_node_kind;
49 /**
50 * \ingroup TGitCache
51 * RAII class that temporarily disables updates for the given path
52 * by sending TGITCACHECOMMAND_BLOCK and TGITCACHECOMMAND_UNBLOCK.
54 class CBlockCacheForPath
56 private:
57 WCHAR path[MAX_PATH+1];
59 public:
60 CBlockCacheForPath(const WCHAR * aPath);
61 ~CBlockCacheForPath();
64 /**
65 * \ingroup TGitCache
66 * A structure passed as a request from the shell (or other client) to the external cache
68 struct TGITCacheRequest
70 DWORD flags;
71 WCHAR path[MAX_PATH+1];
74 // CustomActions will use this header but does not need nor understand the SVN types ...
76 /**
77 * \ingroup TGitCache
78 * The structure returned as a response
80 struct TGITCacheResponse
82 git_wc_status2_t m_status;
83 bool m_bAssumeValid;
84 bool m_bSkipWorktree;
87 /**
88 * \ingroup TGitCache
89 * a cache command
91 struct TGITCacheCommand
93 BYTE command; ///< the command to execute
94 WCHAR path[MAX_PATH+1]; ///< path to do the command for
97 #define TGITCACHECOMMAND_END 0 ///< ends the thread handling the pipe communication
98 #define TGITCACHECOMMAND_CRAWL 1 ///< start crawling the specified path for changes
99 #define TGITCACHECOMMAND_REFRESHALL 2 ///< Refreshes the whole cache, usually necessary after the "treat unversioned files as modified" option changed.
100 #define TGITCACHECOMMAND_RELEASE 3 ///< Releases all open handles for the specified path and all paths below
101 #define TGITCACHECOMMAND_BLOCK 4 ///< Blocks a path from getting crawled for a specific amount of time or until the TGITCACHECOMMAND_UNBLOCK command is sent for that path
102 #define TGITCACHECOMMAND_UNBLOCK 5 ///< Removes a path from the list of paths blocked from getting crawled
104 /// Set this flag if you already know whether or not the item is a folder
105 #define TGITCACHE_FLAGS_FOLDERISKNOWN 0x01
106 /// Set this flag if the item is a folder
107 #define TGITCACHE_FLAGS_ISFOLDER 0x02
108 /// Set this flag if you want recursive folder status (safely ignored for file paths)
109 #define TGITCACHE_FLAGS_RECUSIVE_STATUS 0x04
110 /// Set this flag if notifications to the shell are not allowed
111 #define TGITCACHE_FLAGS_NONOTIFICATIONS 0x08