Debian Codegraph @

src/Utils/Path.cpp

raw
1 // For all support, instructions and copyright go to:
2 // http://e2guardian.org/
3 // Released under the GPL v2, with the OpenSSL exception described in the README file.
4
5 // INCLUDES
6
7 #ifdef HAVE_CONFIG_H
8 #include "e2config.h"
9 #endif
10
11 #include "Path.hpp"
12
13 Path::~Path()
14 {
15 }
16
17 Path Path::baseDir() const
18 {
19 size_t fnsize;
20 if ((fnsize = _path.find_last_of("/")) > 0)
21 return Path(_path.substr(0,++fnsize));
22 else
23 return Path("");
24 }
25
26 void Path::append(const Path &relative_path) {
27 _path += relative_path._path;
28 }
29
30 Path Path::combine(const Path &relative_path) {
31 Path temp(*this);
32 temp.append(relative_path);
33 return temp;
34 }