0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Path.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
27 #ifndef HYPERTABLE_PATH_H
28 #define HYPERTABLE_PATH_H
29 
30 #include <boost/version.hpp>
31 #include <boost/filesystem.hpp>
32 
33 #include "Common/String.h"
34 
35 namespace Hypertable {
36 
45 class Path : public boost::filesystem::path {
46  typedef boost::filesystem::path Parent;
47 
48 public:
49  Path() { }
50  Path(const String &s) : Parent(s) { }
51  Path(const char *s) : Parent(s) { }
52  Path(const Parent &path) : Parent(path) { }
53 
54  Path &operator=(const Parent &path) {
55  Parent::operator=(path);
56  return *this;
57  }
58 
59 #if BOOST_VERSION < 103600
60  bool has_parent_path() const { return has_branch_path(); }
61  Path parent_path() const { return branch_path(); }
62  String filename() const { return leaf(); }
63 #endif
64 };
65 
68 } // namespace Hypertable
69 
70 #endif // HYPERTALBE_FILESYSTEM_H
Path(const char *s)
Definition: Path.h:51
Path parent_path() const
Definition: Path.h:61
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
String filename() const
Definition: Path.h:62
boost::filesystem::path Parent
Definition: Path.h:46
Compatibility class for boost::filesystem::path.
Definition: Path.h:45
bool has_parent_path() const
Definition: Path.h:60
Path(const String &s)
Definition: Path.h:50
Hypertable definitions
Path & operator=(const Parent &path)
Definition: Path.h:54
Path(const Parent &path)
Definition: Path.h:52
A String class based on std::string.