PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/win32/shellext/DirectoryStatus.h

https://bitbucket.org/tortoisehg/hgtk/
C++ Header | 45 lines | 22 code | 9 blank | 14 comment | 0 complexity | 2efedd7779beca79e46d72e76977d286 MD5 | raw file
 1
 2// Copyright (C) 2009 Adrian Buehlmann
 3//
 4// This program is free software: you can redistribute it and/or modify
 5// it under the terms of the GNU General Public License as published by
 6// the Free Software Foundation, either version 2 of the License, or
 7// (at your option) any later version.
 8//
 9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17#include <string>
18#include <vector>
19
20
21class DirectoryStatus
22{
23    struct E
24    {
25        std::string path_;
26        char status_;
27
28        E(): status_(0) {}
29    };
30
31    typedef std::vector<E> V;
32    V v_;
33    bool noicons_;
34
35public:
36    DirectoryStatus(): noicons_(false) {}
37
38    static DirectoryStatus* get(
39        const std::string& hgroot, const std::string& cwd);
40    char status(const std::string& relpath) const;
41    bool noicons() const { return noicons_; }
42
43private:
44    int read(const std::string& hgroot, const std::string& cwd);
45};