diff --git a/dlib/dir_nav/dir_nav_kernel_1.h b/dlib/dir_nav/dir_nav_kernel_1.h index 115f9adf0..af1c34bc6 100644 --- a/dlib/dir_nav/dir_nav_kernel_1.h +++ b/dlib/dir_nav/dir_nav_kernel_1.h @@ -101,6 +101,9 @@ namespace dlib inline const std::string& full_name ( ) const { return state.full_name; } + operator std::string ( + ) const { return full_name(); } + inline uint64 size ( ) const { return state.file_size; } diff --git a/dlib/dir_nav/dir_nav_kernel_2.h b/dlib/dir_nav/dir_nav_kernel_2.h index 5f8f31df5..cb433da00 100644 --- a/dlib/dir_nav/dir_nav_kernel_2.h +++ b/dlib/dir_nav/dir_nav_kernel_2.h @@ -109,6 +109,9 @@ namespace dlib inline uint64 size ( ) const { return state.file_size; } + operator std::string ( + ) const { return full_name(); } + bool operator == ( const file& rhs ) const; diff --git a/dlib/dir_nav/dir_nav_kernel_abstract.h b/dlib/dir_nav/dir_nav_kernel_abstract.h index 147641f8c..8f237e42e 100644 --- a/dlib/dir_nav/dir_nav_kernel_abstract.h +++ b/dlib/dir_nav/dir_nav_kernel_abstract.h @@ -139,6 +139,14 @@ namespace dlib - returns the size of this file in bytes. !*/ + operator std::string ( + ) const; + /*! + ensures + - returns full_name() + (i.e. provides an implicit conversion to string from dlib::file) + !*/ + file& operator= ( const file& rhs );