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
8ebf2031
Commit
8ebf2031
authored
Jul 08, 2011
by
Davis King
Browse files
Added a file_exists() function.
parent
ed4fad06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
dlib/dir_nav/dir_nav_extensions.cpp
dlib/dir_nav/dir_nav_extensions.cpp
+17
-0
dlib/dir_nav/dir_nav_extensions.h
dlib/dir_nav/dir_nav_extensions.h
+6
-0
dlib/dir_nav/dir_nav_extensions_abstract.h
dlib/dir_nav/dir_nav_extensions_abstract.h
+13
-0
No files found.
dlib/dir_nav/dir_nav_extensions.cpp
View file @
8ebf2031
...
...
@@ -34,6 +34,23 @@ namespace dlib
}
}
// ----------------------------------------------------------------------------------------
bool
file_exists
(
const
std
::
string
&
filename
)
{
try
{
dlib
::
file
temp
(
filename
);
return
true
;
}
catch
(
file
::
file_not_found
&
)
{
return
false
;
}
}
// ----------------------------------------------------------------------------------------
directory
get_parent_directory
(
...
...
dlib/dir_nav/dir_nav_extensions.h
View file @
8ebf2031
...
...
@@ -13,6 +13,12 @@
namespace
dlib
{
// ----------------------------------------------------------------------------------------
bool
file_exists
(
const
std
::
string
&
filename
);
// ----------------------------------------------------------------------------------------
namespace
implementation_details
...
...
dlib/dir_nav/dir_nav_extensions_abstract.h
View file @
8ebf2031
...
...
@@ -10,6 +10,19 @@
namespace
dlib
{
// ----------------------------------------------------------------------------------------
bool
file_exists
(
const
std
::
string
&
filename
);
/*!
ensures
- if (a file with the given filename exists) then
- returns true
- else
- returns false
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
...
...
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