Commit fc8807a7 authored by Davis King's avatar Davis King

Added constructors that take const char* so that you don't have to explicitly

convert literal strings to files or directories.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403431
parent df82747e
......@@ -24,8 +24,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
file::
file (
void file::
init (
const std::string& name
)
{
......@@ -95,8 +95,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
directory::
directory (
void directory::
init (
const std::string& name
)
{
......
......@@ -59,6 +59,7 @@ namespace dlib
};
void init ( const std::string& name);
public:
......@@ -94,7 +95,11 @@ namespace dlib
file (
const std::string& name
);
) { init(name); }
file (
const char* name
) { init(name); }
inline file (
const file& item
......@@ -181,6 +186,9 @@ namespace dlib
is_root() == state->name.size() == 0
!*/
void init (const std::string& name);
public:
struct data
......@@ -229,7 +237,11 @@ namespace dlib
directory (
const std::string& name
);
) { init(name); }
directory (
const char* name
) { init(name); }
inline directory (
const directory& item
......
......@@ -23,8 +23,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
file::
file (
void file::
init (
const std::string& name
)
{
......@@ -100,8 +100,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
directory::
directory (
void directory::
init (
const std::string& name
)
{
......
......@@ -66,6 +66,7 @@ namespace dlib
unsigned long count;
};
void init(const std::string& name);
public:
......@@ -99,7 +100,11 @@ namespace dlib
file (
const std::string& name
);
) { init(name); }
file (
const char* name
) { init(name); }
inline file (
const file& item
......@@ -187,6 +192,8 @@ namespace dlib
!*/
void init(const std::string& name);
public:
struct private_constructor{};
inline directory (
......@@ -224,7 +231,11 @@ namespace dlib
directory (
const std::string& name
);
) { init(name); }
directory (
const char* name
) { init(name); }
inline directory (
const directory& item
......
......@@ -96,6 +96,14 @@ namespace dlib
accessed.
!*/
file (
const char* name
);
/*!
ensures
- this function is idential to file(const std::string& name)
!*/
file (
const file& item
);
......@@ -230,6 +238,14 @@ namespace dlib
accessed.
!*/
directory (
const char* name
);
/*!
ensures
- this function is idential to directory(const std::string& name)
!*/
directory (
const directory& item
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment