Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
2f4e373b
"git@developer.sourcefind.cn:OpenDAS/nerfacc.git" did not exist on "bc7f7fffc855c38c640aeb6968c6c5e8c5cf24a2"
Commit
2f4e373b
authored
Jul 01, 2017
by
Davis King
Browse files
Added file::last_modified() for windows version of code.
parent
e00352aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
dlib/dir_nav/dir_nav_kernel_1.cpp
dlib/dir_nav/dir_nav_kernel_1.cpp
+6
-0
dlib/dir_nav/dir_nav_kernel_1.h
dlib/dir_nav/dir_nav_kernel_1.h
+15
-1
No files found.
dlib/dir_nav/dir_nav_kernel_1.cpp
View file @
2f4e373b
...
@@ -66,6 +66,12 @@ namespace dlib
...
@@ -66,6 +66,12 @@ namespace dlib
temp
|=
data
.
nFileSizeLow
;
temp
|=
data
.
nFileSizeLow
;
state
.
file_size
=
temp
;
state
.
file_size
=
temp
;
FindClose
(
ffind
);
FindClose
(
ffind
);
ULARGE_INTEGER
ull
;
ull
.
LowPart
=
data
.
ftLastWriteTime
.
dwLowDateTime
;
ull
.
HighPart
=
data
.
ftLastWriteTime
.
dwHighDateTime
;
std
::
chrono
::
nanoseconds
epoch
(
100
*
(
ull
.
QuadPart
-
116444736000000000
));
state
.
last_modified
=
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
(
std
::
chrono
::
duration_cast
<
std
::
chrono
::
system_clock
::
duration
>
(
epoch
));
}
}
}
}
...
...
dlib/dir_nav/dir_nav_kernel_1.h
View file @
2f4e373b
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "../stl_checked.h"
#include "../stl_checked.h"
#include "../enable_if.h"
#include "../enable_if.h"
#include "../queue.h"
#include "../queue.h"
#include <chrono>
namespace
dlib
namespace
dlib
{
{
...
@@ -54,6 +55,7 @@ namespace dlib
...
@@ -54,6 +55,7 @@ namespace dlib
uint64
file_size
;
uint64
file_size
;
std
::
string
name
;
std
::
string
name
;
std
::
string
full_name
;
std
::
string
full_name
;
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last_modified
;
};
};
...
@@ -66,12 +68,14 @@ namespace dlib
...
@@ -66,12 +68,14 @@ namespace dlib
const
std
::
string
&
name
,
const
std
::
string
&
name
,
const
std
::
string
&
full_name
,
const
std
::
string
&
full_name
,
const
uint64
file_size
,
const
uint64
file_size
,
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>&
last_modified
,
private_constructor
private_constructor
)
)
{
{
state
.
file_size
=
file_size
;
state
.
file_size
=
file_size
;
state
.
name
=
name
;
state
.
name
=
name
;
state
.
full_name
=
full_name
;
state
.
full_name
=
full_name
;
state
.
last_modified
=
last_modified
;
}
}
...
@@ -107,6 +111,9 @@ namespace dlib
...
@@ -107,6 +111,9 @@ namespace dlib
inline
uint64
size
(
inline
uint64
size
(
)
const
{
return
state
.
file_size
;
}
)
const
{
return
state
.
file_size
;
}
inline
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last_modified
(
)
const
{
return
state
.
last_modified
;
}
bool
operator
==
(
bool
operator
==
(
const
file
&
rhs
const
file
&
rhs
)
const
;
)
const
;
...
@@ -413,8 +420,15 @@ namespace dlib
...
@@ -413,8 +420,15 @@ namespace dlib
uint64
file_size
=
data
.
nFileSizeHigh
;
uint64
file_size
=
data
.
nFileSizeHigh
;
file_size
<<=
32
;
file_size
<<=
32
;
file_size
|=
data
.
nFileSizeLow
;
file_size
|=
data
.
nFileSizeLow
;
ULARGE_INTEGER
ull
;
ull
.
LowPart
=
data
.
ftLastWriteTime
.
dwLowDateTime
;
ull
.
HighPart
=
data
.
ftLastWriteTime
.
dwHighDateTime
;
std
::
chrono
::
nanoseconds
epoch
(
100
*
(
ull
.
QuadPart
-
116444736000000000
));
auto
last_modified
=
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
(
std
::
chrono
::
duration_cast
<
std
::
chrono
::
system_clock
::
duration
>
(
epoch
));
// this is a file so add it to the queue
// this is a file so add it to the queue
file
temp
(
data
.
cFileName
,
path
+
data
.
cFileName
,
file_size
,
private_constructor
());
file
temp
(
data
.
cFileName
,
path
+
data
.
cFileName
,
file_size
,
last_modified
,
private_constructor
());
files
.
enqueue
(
temp
);
files
.
enqueue
(
temp
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment