|
a/src/utils/pathut.cpp |
|
b/src/utils/pathut.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.5 2005-11-24 07:16:16 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.6 2005-12-13 12:42:59 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
|
4 |
|
5 |
#ifndef TEST_PATHUT
|
5 |
#ifndef TEST_PATHUT
|
6 |
#include <unistd.h>
|
6 |
#include <unistd.h>
|
7 |
#include <pwd.h>
|
7 |
#include <pwd.h>
|
|
... |
|
... |
9 |
|
9 |
|
10 |
#include "pathut.h"
|
10 |
#include "pathut.h"
|
11 |
#ifndef NO_NAMESPACES
|
11 |
#ifndef NO_NAMESPACES
|
12 |
using std::string;
|
12 |
using std::string;
|
13 |
#endif /* NO_NAMESPACES */
|
13 |
#endif /* NO_NAMESPACES */
|
|
|
14 |
|
|
|
15 |
void path_catslash(std::string &s) {
|
|
|
16 |
if (s.empty() || s[s.length() - 1] != '/')
|
|
|
17 |
s += '/';
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
std::string path_cat(const std::string &s1, const std::string &s2) {
|
|
|
21 |
std::string res = s1;
|
|
|
22 |
path_catslash(res);
|
|
|
23 |
res += s2;
|
|
|
24 |
return res;
|
|
|
25 |
}
|
14 |
|
26 |
|
15 |
string path_getfather(const string &s) {
|
27 |
string path_getfather(const string &s) {
|
16 |
string father = s;
|
28 |
string father = s;
|
17 |
|
29 |
|
18 |
// ??
|
30 |
// ??
|