PageRenderTime 28ms CodeModel.GetById 19ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/win32/shellext/Dirstatecache.h

https://bitbucket.org/tortoisehg/hgtk/
C++ Header | 55 lines | 30 code | 10 blank | 15 comment | 0 complexity | 889e6d70b5c09d2de3de48834664ffec MD5 | raw file
 1
 2// Copyright (C) 2009 Benjamin Pollack
 3// Copyright (C) 2009 Adrian Buehlmann
 4//
 5// This program is free software: you can redistribute it and/or modify
 6// it under the terms of the GNU General Public License as published by
 7// the Free Software Foundation, either version 2 of the License, or
 8// (at your option) any later version.
 9//
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.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18#ifndef _DIRSTATECACHE_H
19#define _DIRSTATECACHE_H
20
21#include <string>
22#include <list>
23
24class Dirstate;
25
26class Dirstatecache
27{
28    struct E
29    {
30        Dirstate*       dstate;
31        __int64         dstate_mtime;
32        __int64         dstate_size;
33
34        std::string     hgroot;
35        unsigned        tickcount;
36        bool            unset;
37
38        E(): 
39            dstate(0), 
40            dstate_mtime(0), 
41            dstate_size(0), 
42            tickcount(0),
43            unset(false)
44        {}         
45    };
46
47    static std::list<E>& cache();
48
49public:
50    static Dirstate* get(
51        const std::string& hgroot, const std::string& cwd, bool& unset);
52    static void invalidate(const std::string& hgroot);
53};
54
55#endif