SvnCpp
path.hpp
Go to the documentation of this file.
1/*
2 * ====================================================================
3 * Copyright (c) 2002-2018 The RapidSVN Group. All rights reserved.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program (in the file LGPL.txt).
17 * If not, see <http://www.gnu.org/licenses/>.
18 *
19 * This software consists of voluntary contributions made by many
20 * individuals. For exact contribution history, see the revision
21 * history and logs, available at http://rapidsvn.tigris.org/.
22 * ====================================================================
23 */
24
25#ifndef _SVNCPP_PATH_HPP_
26#define _SVNCPP_PATH_HPP_
27
28// stl
31
32namespace svn
33{
37 class Path
38 {
39 private:
40 std::string m_path;
41 bool m_pathIsUrl;
42
48 void init(const char * path);
49
50 public:
58 Path(const std::string & path = "");
59
66 Path(const char * path);
67
73 Path(const Path & path);
74
79
83 bool
84 operator== (const Path&) const;
85
89 const std::string &
90 path() const;
91
95 const char *
96 c_str() const;
97
110 bool
111 isSet() const;
112
118 bool
119 isUrl() const;
120
126 void
127 addComponent(const char * component);
128
134 void
135 addComponent(const std::string & component);
136
143 void
144 split(std::string & dirpath, std::string & basename) const;
145
154 void
155 split(std::string & dir, std::string & filename, std::string & ext) const;
156
162 std::string
163 basename() const;
164
170 std::string
171 dirpath() const;
172
179 std::string
180 substr(const size_t index) const;
181
187 std::string
188 unescape() const;
189
193 static Path
195
197 size_t
198 length() const;
199
201 std::string
202 native() const;
203 };
204
205 typedef std::vector<Path> PathVector;
206
207 extern const PathVector EmptyPathVector;
208}
209
210#endif
211/* -----------------------------------------------------------------
212 * local variables:
213 * eval: (load-file "../../rapidsvn-dev.el")
214 * end:
215 */
Definition path.hpp:38
const std::string & path() const
Path(const char *path)
std::string dirpath() const
Path(const Path &path)
std::string unescape() const
void addComponent(const std::string &component)
std::string substr(const size_t index) const
void split(std::string &dirpath, std::string &basename) const
std::string basename() const
Path & operator=(const Path &)
bool isUrl() const
std::string native() const
bool isSet() const
void split(std::string &dir, std::string &filename, std::string &ext) const
bool operator==(const Path &) const
static Path getTempDir()
size_t length() const
const char * c_str() const
Path(const std::string &path="")
void addComponent(const char *component)
Definition annotate_line.hpp:32
const PathVector EmptyPathVector
std::vector< Path > PathVector
Definition path.hpp:205