VICI  0.11.815
Visual Chart Interpreter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
VICI::Path Class Reference

Manipulate path strings. More...

#include <vici/stringy.h>

Inheritance diagram for VICI::Path:

Public Member Functions

 Path ()
 Constructor.
 
 Path (csr path)
 Constructor. More...
 
Pathappend (csr name)
 Append aname to a path. More...
 
PathappendExt (csr ext)
 Append an extension to this. More...
 
Pathup ()
 shorten this by a level More...
 
bool absolute () const
 
std::string base () const
 
std::string dir () const
 
std::string ext () const
 
std::string name () const
 
std::string noExt () const
 
void split (std::vector< std::string > &dirs) const
 break into separate dirs More...
 
bool operator== (const Path &x) const
 test for equality
 
bool isChildOf (const Path &p) const
 test for equality More...
 
Pathoperator= (const char *)
 assignment
 
Pathoperator= (const std::string &)
 assignment
 
 operator const char * () const
 type conversion
 
bool defined () const
 type conversion More...
 

Static Public Member Functions

static bool check (const std::string &path)
 checks for valid string
 
static void setSpacePolicy (bool allowSpaces=false)
 set policy for spaces in file names
 

Detailed Description

Manipulate path strings.

Constructor & Destructor Documentation

Path::Path ( csr  path)
explicit

Constructor.

normalizes out any surplus /'s

Parameters
pathpath to a file or directory

Member Function Documentation

bool Path::absolute ( ) const
Returns
true if its an absolute path
Path & Path::append ( csr  name)

Append aname to a path.

Parameters
nameappend a / and name to this
Returns
reference to new value of this
Path & Path::appendExt ( csr  ext)

Append an extension to this.

Parameters
extthe extension to append.
Returns
reference to new value of this
string Path::base ( ) const
Returns
everything after last /
bool Path::defined ( ) const

type conversion

true if it has a value

string Path::dir ( ) const
Returns
everything up to last /
string Path::ext ( ) const
Returns
extension part of file name
bool Path::isChildOf ( const Path p) const

test for equality

test for equality true if this is a subdir of p

string Path::name ( ) const
Returns
base without the extension
string Path::noExt ( ) const
Returns
everything but extension
void Path::split ( std::vector< std::string > &  dirs) const

break into separate dirs

Parameters
dirsThe directory parts of the file name returned.
Path & Path::up ( )

shorten this by a level

Returns
reference to new value of this

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