libqi-api  2.4.3.28
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
qi::Path Class Reference

The Path class allow handling path in a cross-platform maner. The class assume that all string are encoded in UTF-8. More...

#include <path.hpp>

Public Member Functions

 Path (const std::string &unicodePath=std::string())
 
 Path (const char *unicodePath)
 
 Path (const Path &path)
 Copy Constructor. More...
 
 Path (const boost::filesystem::path &path)
 Copy Constructor from boost filesystem. More...
 
 ~Path ()
 Default destructor. More...
 
bool isEmpty () const
 is the path empty? More...
 
bool exists () const
 does this file exist? More...
 
bool isDir () const
 is the path a directory? More...
 
bool isRegularFile () const
 is the path a regular file? More...
 
bool isSymlink () const
 is the path a symlink? More...
 
std::string filename () const
 get the name of the current file of folder More...
 
std::string extension () const
 get the extension of the current file More...
 
Path parent () const
 return a Path to the parent More...
 
Path absolute () const
 return an absolute Path of the current path More...
 
PathVector files () const
 return a vector of files contained in the current path More...
 
PathVector recursiveFiles () const
 return a vector of absolute path to files contained recursively in the current path More...
 
PathVector dirs () const
 return a vector of dirs contained in the current path More...
 
 operator std::string () const
 return the path as a string More...
 
std::string str () const
 return the path as a string More...
 
const boost::filesystem::path & bfsPath () const
 return the path as a boost path representation More...
 
Path operator/ (const qi::Path &rhs) const
 concat two paths adding a directory separator between them More...
 
const Path & operator/= (const qi::Path &rhs) const
 concat two paths adding a directory separator between them More...
 
const Path & operator= (const qi::Path &rhs) const
 copy operator More...
 

Friends

std::ostream & operator<< (std::ostream &output, const qi::Path &path)
 Standard output stream operator for logging. More...
 

Detailed Description

The Path class allow handling path in a cross-platform maner. The class assume that all string are encoded in UTF-8.

Definition at line 34 of file path.hpp.

Constructor & Destructor Documentation

qi::Path::Path ( const std::string &  unicodePath = std::string())

Default Constructor

Parameters
unicodePathPath
qi::Path::Path ( const char *  unicodePath)
Parameters
unicodePathPath
qi::Path::Path ( const Path &  path)

Copy Constructor.

qi::Path::Path ( const boost::filesystem::path &  path)

Copy Constructor from boost filesystem.

qi::Path::~Path ( )

Default destructor.

Member Function Documentation

Path qi::Path::absolute ( ) const

return an absolute Path of the current path

const boost::filesystem::path& qi::Path::bfsPath ( ) const

return the path as a boost path representation

PathVector qi::Path::dirs ( ) const

return a vector of dirs contained in the current path

bool qi::Path::exists ( ) const

does this file exist?

std::string qi::Path::extension ( ) const

get the extension of the current file

std::string qi::Path::filename ( ) const

get the name of the current file of folder

PathVector qi::Path::files ( ) const

return a vector of files contained in the current path

bool qi::Path::isDir ( ) const

is the path a directory?

bool qi::Path::isEmpty ( ) const

is the path empty?

bool qi::Path::isRegularFile ( ) const

is the path a regular file?

bool qi::Path::isSymlink ( ) const

is the path a symlink?

qi::Path::operator std::string ( ) const

return the path as a string

Path qi::Path::operator/ ( const qi::Path &  rhs) const

concat two paths adding a directory separator between them

const Path& qi::Path::operator/= ( const qi::Path &  rhs) const

concat two paths adding a directory separator between them

const Path& qi::Path::operator= ( const qi::Path &  rhs) const

copy operator

Path qi::Path::parent ( ) const

return a Path to the parent

PathVector qi::Path::recursiveFiles ( ) const

return a vector of absolute path to files contained recursively in the current path

std::string qi::Path::str ( ) const

return the path as a string

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const qi::Path &  path 
)
friend

Standard output stream operator for logging.

Definition at line 107 of file path.hpp.


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