Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: extract Winstat64.h and *.cpp

Changeset 99ab50161592

Parent ac94736a89d9

by Adrian Buehlmann

Changes to 4 files · Browse files at 99ab50161592 Showing diff from parent ac94736a89d9 Diff from another changeset...

 
19
20
21
22
 
23
24
25
 
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
19
20
21
 
22
23
24
25
 
29
30
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
33
34
@@ -19,7 +19,7 @@
   #include "Dirstatecache.h"  #include "dirstate.h" -#include "Winstat.h" +#include "Winstat64.h"      std::list<Dirstatecache::E>& Dirstatecache::cache() @@ -29,32 +29,6 @@
 }     -struct Winstat64 -{ - __time64_t mtime; - __int64 size; - int lstat(const char* path); -}; - - -int Winstat64::lstat(const char* path) -{ - WIN32_FIND_DATAA data; - HANDLE hfind; - - hfind = FindFirstFileA(path, &data); - if (hfind == INVALID_HANDLE_VALUE) - return -1; - FindClose(hfind); - - this->mtime = *(__time64_t*)&data.ftLastWriteTime; - this->size = ((__int64)data.nFileSizeHigh << sizeof(data.nFileSizeHigh)) - | data.nFileSizeLow; - - return 0; -} - -  Dirstate* Dirstatecache::get(const std::string& hgroot)  {   typedef std::list<E>::iterator Iter;
 
11
12
13
 
14
15
16
 
11
12
13
14
15
16
17
@@ -11,6 +11,7 @@
  ShellUtils2.o \   StringUtils.o \   dirstate.o \ + Winstat64.o \   Dirstatecache.o \   DirectoryStatus.o \   QueryDirstate.o
Change 1 of 1 Show Entire File win32/​shellext/​Winstat64.cpp Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@@ -0,0 +1,36 @@
+ +// Copyright (C) 2009 Adrian Buehlmann +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "stdafx.h" + +#include "Winstat64.h" + +int Winstat64::lstat(const char* path) +{ + WIN32_FIND_DATAA data; + HANDLE hfind; + + hfind = FindFirstFileA(path, &data); + if (hfind == INVALID_HANDLE_VALUE) + return -1; + FindClose(hfind); + + this->mtime = *(__time64_t*)&data.ftLastWriteTime; + this->size = ((__int64)data.nFileSizeHigh << sizeof(data.nFileSizeHigh)) + | data.nFileSizeLow; + + return 0; +}
Change 1 of 1 Show Entire File win32/​shellext/​Winstat64.h Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@@ -0,0 +1,27 @@
+ +// Copyright (C) 2009 Adrian Buehlmann +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#ifndef WINSTAT64_H +#define WINSTAT64_H + +struct Winstat64 +{ + __time64_t mtime; + __int64 size; + int lstat(const char* path); +}; + +#endif