path.hpp
Go to the documentation of this file.
/*
* ====================================================================
* Copyright (c) 2002-2009 The RapidSvn Group. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program (in the file GPL.txt.
* If not, see <http://www.gnu.org/licenses/>.
*
* This software consists of voluntary contributions made by many
* individuals. For exact contribution history, see the revision
* history and logs, available at http://rapidsvn.tigris.org/.
* ====================================================================
*/
#ifndef _SVNCPP_PATH_HPP_
#define _SVNCPP_PATH_HPP_
// stl
#include "svncpp/string_wrapper.hpp"
#include "svncpp/vector_wrapper.hpp"
namespace svn
{
class Path
{
private:
std::string m_path;
bool m_pathIsUrl;
void init(const char * path);
public:
Path(const std::string & path = "");
Path(const char * path);
Path(const Path & path);
Path& operator= (const Path&);
bool
operator== (const Path&) const;
const std::string &
path() const;
const char *
c_str() const;
bool
isSet() const;
bool
isUrl() const;
void
addComponent(const char * component);
void
addComponent(const std::string & component);
void
split(std::string & dirpath, std::string & basename) const;
void
split(std::string & dir, std::string & filename, std::string & ext) const;
std::string
basename() const;
std::string
dirpath() const;
std::string
substr(const size_t index) const;
std::string
unescape() const;
static Path
getTempDir();
size_t
length() const;
std::string
native() const;
};
typedef std::vector<Path> PathVector;
extern const PathVector EmptyPathVector;
}
#endif
/* -----------------------------------------------------------------
* local variables:
* eval: (load-file "../../rapidsvn-dev.el")
* end:
*/
string_wrapper.hpp
svn::Path::split
void split(std::string &dirpath, std::string &basename) const
svn::Path::basename
std::string basename() const
svn::EmptyPathVector
const PathVector EmptyPathVector
svn::Path
Definition: path.hpp:37
svn::Path::substr
std::string substr(const size_t index) const
svn::Path::operator=
Path & operator=(const Path &)
svn::Path::getTempDir
static Path getTempDir()
svn::Path::isUrl
bool isUrl() const
svn
Definition: annotate_line.hpp:31
svn::Path::native
std::string native() const
svn::Path::addComponent
void addComponent(const char *component)
svn::Path::c_str
const char * c_str() const
svn::Path::path
const std::string & path() const
svn::PathVector
std::vector< Path > PathVector
Definition: path.hpp:205
svn::Path::operator==
bool operator==(const Path &) const
svn::Path::length
size_t length() const
svn::Path::dirpath
std::string dirpath() const
svn::Path::Path
Path(const std::string &path="")
svn::Path::isSet
bool isSet() const
vector_wrapper.hpp
svn::Path::unescape
std::string unescape() const