Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
8ebf2031
Commit
8ebf2031
authored
Jul 08, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a file_exists() function.
parent
ed4fad06
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
dir_nav_extensions.cpp
dlib/dir_nav/dir_nav_extensions.cpp
+17
-0
dir_nav_extensions.h
dlib/dir_nav/dir_nav_extensions.h
+6
-0
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