ThirdParty
Ert
lib
private-include
detail
util
path.hpp
Go to the documentation of this file.
1
#ifndef PATH_UTIL
2
#define PATH_UTIL
3
4
5
#include <string>
6
namespace
ecl
{
7
namespace
util {
8
namespace
path {
9
/*
10
Observe that these functions are purely based on string inspection; i.e.
11
the actual filesystem is *never* consulted. Furthermore the functions
12
interpret the argument as a *filename* - that implies the (maybe
13
surprising) semantics:
14
15
dirname("/tmp") => "/"
16
basename("/tmp") => "tmp"
17
18
Although if you actually checked the filesystem you would of course
19
discover that /tmp actually is a directory. This is the same behaviour
20
as the os.path.dirname() and os.path.basename() functions in the Python
21
library.
22
*/
23
24
std::string
dirname
(
const
std::string
& fname);
25
std::string
basename
(
const
std::string
& fname);
26
std::string
extension
(
const
std::string
& fname);
27
}
28
}
29
}
30
31
32
#endif
string
const char *const string
Definition:
cJSON.h:170
ecl::util::path::basename
std::string basename(const std::string &fname)
ecl::util::path::extension
std::string extension(const std::string &fname)
ecl::util::path::dirname
std::string dirname(const std::string &fname)
ecl
Definition:
ecl_box.hpp:26