SvnCpp
svn::Path Class Reference

#include <path.hpp>

Public Member Functions

 Path (const std::string &path="")
 
 Path (const char *path)
 
 Path (const Path &path)
 
Pathoperator= (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
 
size_t length () const
 
std::string native () const
 

Static Public Member Functions

static Path getTempDir ()
 

Detailed Description

Encapsulation for Subversion Path handling

Constructor & Destructor Documentation

◆ Path() [1/3]

svn::Path::Path ( const std::string & path = "")

Constructor that takes a string as parameter. The string is converted to subversion internal representation. The string is copied.

Parameters
pathPath string

Referenced by svn::RepositoryPath::operator=(), and svn::RepositoryPath::operator==().

◆ Path() [2/3]

svn::Path::Path ( const char * path)

Constructor

See also
Path::Path (const std::string &)
Parameters
pathPath string

◆ Path() [3/3]

svn::Path::Path ( const Path & path)

Copy constructor

Parameters
pathPath to be copied

Member Function Documentation

◆ addComponent() [1/2]

void svn::Path::addComponent ( const char * component)

adds a new URL component to the path

Parameters
componentnew component to add

◆ addComponent() [2/2]

void svn::Path::addComponent ( const std::string & component)

adds a new URL component to the path

Parameters
componentnew component to add

◆ basename()

std::string svn::Path::basename ( ) const

get a basename of a file

Returns
basename filename without path

◆ c_str()

const char * svn::Path::c_str ( ) const
Returns
Path string as c string

◆ dirpath()

std::string svn::Path::dirpath ( ) const

get a name of directory containing file

Returns
dirpath path of directory

◆ getTempDir()

static Path svn::Path::getTempDir ( )
static

returns the temporary directory

◆ isSet()

bool svn::Path::isSet ( ) const

check whether a path is set. Right now this checks only if the string is non- empty.

Note
This is the successor of isset which had to be removed since there was a name conflict with system headers on some systems (see issue 676)
Since
0.12
Returns
true if there is a path set

◆ isUrl()

bool svn::Path::isUrl ( ) const

shows whether we have a path or url

Returns
true if the path is a valid url

◆ length()

size_t svn::Path::length ( ) const

return the length of the path-string

◆ native()

std::string svn::Path::native ( ) const

returns the path with native separators

◆ operator=()

Path & svn::Path::operator= ( const Path & )

Assignment operator

◆ operator==()

bool svn::Path::operator== ( const Path & ) const

Comparison operator

◆ path()

const std::string & svn::Path::path ( ) const

◆ split() [1/2]

void svn::Path::split ( std::string & dir,
std::string & filename,
std::string & ext ) const

split path in its components including file extension

Parameters
dirdirectory component
filenamefilename
extextension (including leading dot ".")

◆ split() [2/2]

void svn::Path::split ( std::string & dirpath,
std::string & basename ) const

split path in its components

Parameters
dirpathdirectory/path component
basenamefilename

◆ substr()

std::string svn::Path::substr ( const size_t index) const

get a substring of a path, starting at index

Parameters
index
Returns
substr substring

◆ unescape()

std::string svn::Path::unescape ( ) const

return path as a string with unescaped special characters

Returns
unescaped path

The documentation for this class was generated from the following file: