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
e00352aa
Commit
e00352aa
authored
Jul 01, 2017
by
Davis King
Browse files
merged
parents
023e1398
56428eb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
dlib/dir_nav/dir_nav_kernel_2.cpp
dlib/dir_nav/dir_nav_kernel_2.cpp
+6
-0
dlib/dir_nav/dir_nav_kernel_2.h
dlib/dir_nav/dir_nav_kernel_2.h
+12
-0
No files found.
dlib/dir_nav/dir_nav_kernel_2.cpp
View file @
e00352aa
...
...
@@ -62,6 +62,12 @@ namespace dlib
else
{
state
.
file_size
=
static_cast
<
uint64
>
(
buffer
.
st_size
);
state
.
last_modified
=
std
::
chrono
::
system_clock
::
from_time_t
(
buffer
.
st_mtime
);
#ifdef _BSD_SOURCE
state
.
last_modified
+=
std
::
chrono
::
nanoseconds
(
buffer
.
st_atim
.
tv_nsec
);
#endif
}
}
...
...
dlib/dir_nav/dir_nav_kernel_2.h
View file @
e00352aa
...
...
@@ -22,6 +22,7 @@
#include <sys/stat.h>
#include <errno.h>
#include <stdlib.h>
#include <chrono>
#if !defined(__USE_LARGEFILE64 ) && !defined(_LARGEFILE64_SOURCE)
#define stat64 stat
...
...
@@ -63,6 +64,7 @@ namespace dlib
uint64
file_size
;
std
::
string
name
;
std
::
string
full_name
;
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last_modified
;
};
void
init
(
const
std
::
string
&
name
);
...
...
@@ -74,12 +76,14 @@ namespace dlib
const
std
::
string
&
name
,
const
std
::
string
&
full_name
,
const
uint64
file_size
,
const
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>&
last_modified
,
private_constructor
)
{
state
.
file_size
=
file_size
;
state
.
name
=
name
;
state
.
full_name
=
full_name
;
state
.
last_modified
=
last_modified
;
}
...
...
@@ -110,6 +114,9 @@ namespace dlib
inline
uint64
size
(
)
const
{
return
state
.
file_size
;
}
inline
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
last_modified
(
)
const
{
return
state
.
last_modified
;
}
operator
std
::
string
(
)
const
{
return
full_name
();
}
...
...
@@ -383,6 +390,10 @@ namespace dlib
{
file_size
=
static_cast
<
uint64
>
(
buffer
.
st_size
);
}
auto
last_modified
=
std
::
chrono
::
system_clock
::
from_time_t
(
buffer
.
st_mtime
);
#ifdef _BSD_SOURCE
last_modified
+=
std
::
chrono
::
nanoseconds
(
buffer
.
st_atim
.
tv_nsec
);
#endif
if
(
S_ISDIR
(
buffer
.
st_mode
)
==
0
)
{
...
...
@@ -391,6 +402,7 @@ namespace dlib
data
->
d_name
,
path
+
data
->
d_name
,
file_size
,
last_modified
,
file
::
private_constructor
()
);
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