SvnCpp
repository_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_REPOSITORY_PATH_HPP_
26 #define _SVNCPP_REPOSITORY_PATH_HPP_
27 
28 #include "svncpp/path.hpp"
29 
30 namespace svn
31 {
35  class RepositoryPath : public Path
36  {
37  private:
38  std::string m_repositoryRoot;
39 
40  RepositoryPath(const Path &) {}
41  Path& operator= (const Path & path) {}
42 
43  public:
53  RepositoryPath(const std::string & path = "", const std::string & repositoryRoot = "")
54  : Path(path), m_repositoryRoot(repositoryRoot) {}
55 
63  RepositoryPath(const char * path, const char * repositoryRoot)
64  : Path(path), m_repositoryRoot(repositoryRoot != NULL ? repositoryRoot : "") {}
65 
72  : Path(path), m_repositoryRoot(path.getRepositoryRoot()) {}
73 
77  RepositoryPath& operator= (const RepositoryPath & path)
78  {
79  if (this == &path)
80  return *this;
81 
82  Path(*this) = path;
83  m_repositoryRoot = path.getRepositoryRoot();
84 
85  return *this;
86  }
87 
91  bool
93  {
94  return Path(*this) == path && m_repositoryRoot == path.getRepositoryRoot();
95  }
96 
98  std::string
100  {
101  return m_repositoryRoot;
102  }
103  };
104 }
105 
106 #endif
107 /* -----------------------------------------------------------------
108  * local variables:
109  * eval: (load-file "../../rapidsvn-dev.el")
110  * end:
111  */
Definition: path.hpp:38
const std::string & path() const
Path(const std::string &path="")
Definition: repository_path.hpp:36
RepositoryPath(const char *path, const char *repositoryRoot)
Definition: repository_path.hpp:63
RepositoryPath(const RepositoryPath &path)
Definition: repository_path.hpp:71
RepositoryPath(const std::string &path="", const std::string &repositoryRoot="")
Definition: repository_path.hpp:53
std::string getRepositoryRoot() const
Definition: repository_path.hpp:99
bool operator==(const RepositoryPath &path) const
Definition: repository_path.hpp:92
Definition: annotate_line.hpp:32