Rosetta 3.3
Public Member Functions | Friends
utility::file::PathName Class Reference

Path name class supporting Windows and UN*X/Linux format names. More...

#include <PathName.hh>

Collaboration diagram for utility::file::PathName:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PathName ()
 Default constructor.
 PathName (std::string const &name_string)
 String constructor.
 ~PathName ()
 Destructor.
PathNameoperator= (std::string const &name_string)
 String assignment.
 operator std::string () const
 String conversion.
PathNameoperator() (PathName const &name)
 Functor copy assignment.
PathNameoperator() (std::string const &name_string)
 Functor string assignment.
PathNamevol (std::string const &vol_a)
 Volume assignment.
PathNamevolume (std::string const &vol_a)
 Volume assignment.
PathNamepath (std::string const &path_a)
 Path assignment.
PathNameerase ()
 Erase the path name.
PathNameclear ()
 Clear the path name.
PathName parent () const
 Returns the parent of this directory, or itself if no parent is available.
bool empty () const
 Empty?
bool absolute () const
 Absolute path?
bool relative () const
 Relative path?
std::string const & vol () const
 Volume.
std::string const & volume () const
 Volume.
std::string const & path () const
 Path.
std::string name () const
 Path name string.
std::string operator() () const
 Functor.

Friends

bool operator== (PathName const &name1, PathName const &name2)
 PathName == PathName.
bool operator!= (PathName const &name1, PathName const &name2)
 PathName != PathName.
bool operator< (PathName const &name1, PathName const &name2)
 PathName < PathName.
bool operator<= (PathName const &name1, PathName const &name2)
 PathName <= PathName.
bool operator>= (PathName const &name1, PathName const &name2)
 PathName >= PathName.
bool operator> (PathName const &name1, PathName const &name2)
 PathName > PathName.
std::istream & operator>> (std::istream &stream, PathName &name)
 Input from stream.
std::ostream & operator<< (std::ostream &stream, PathName const &name)
 Output to stream.

Detailed Description

Path name class supporting Windows and UN*X/Linux format names.


Constructor & Destructor Documentation

utility::file::PathName::PathName ( ) [inline]

Default constructor.

utility::file::PathName::PathName ( std::string const &  name_string) [inline]

String constructor.

utility::file::PathName::~PathName ( ) [inline]

Destructor.


Member Function Documentation

bool utility::file::PathName::absolute ( ) const

Absolute path?

References platform::file::PATH_SEPARATOR().

PathName& utility::file::PathName::clear ( ) [inline]

Clear the path name.

bool utility::file::PathName::empty ( ) const [inline]

Empty?

PathName& utility::file::PathName::erase ( ) [inline]

Erase the path name.

std::string utility::file::PathName::name ( ) const [inline]
utility::file::PathName::operator std::string ( ) const [inline]

String conversion.

References name().

PathName& utility::file::PathName::operator() ( std::string const &  name_string) [inline]

Functor string assignment.

std::string utility::file::PathName::operator() ( ) const [inline]

Functor.

References name().

PathName& utility::file::PathName::operator() ( PathName const &  name) [inline]

Functor copy assignment.

References operator=().

PathName& utility::file::PathName::operator= ( std::string const &  name_string) [inline]

String assignment.

Referenced by operator()().

PathName utility::file::PathName::parent ( ) const

Returns the parent of this directory, or itself if no parent is available.

For relative paths, this will stop when it reaches the empty string -- no "../" will be prepended to possibly go further up the directory tree.

References name(), path(), and platform::file::PATH_SEPARATOR().

Referenced by utility::file::create_directory_recursive().

std::string const& utility::file::PathName::path ( ) const [inline]

Path.

PathName & utility::file::PathName::path ( std::string const &  path_a)

Path assignment.

References platform::file::PATH_SEPARATOR().

Referenced by utility::file::FileName::FileName(), and parent().

bool utility::file::PathName::relative ( ) const

Relative path?

References platform::file::PATH_SEPARATOR().

PathName & utility::file::PathName::vol ( std::string const &  vol_a)

Volume assignment.

References runtime_assert, and platform::file::VOLUME_USED().

Referenced by utility::file::FileName::FileName().

std::string const& utility::file::PathName::vol ( ) const [inline]

Volume.

Referenced by volume().

PathName& utility::file::PathName::volume ( std::string const &  vol_a) [inline]

Volume assignment.

References vol().

std::string const& utility::file::PathName::volume ( ) const [inline]

Volume.


Friends And Related Function Documentation

bool operator!= ( PathName const &  name1,
PathName const &  name2 
) [friend]
bool operator< ( PathName const &  name1,
PathName const &  name2 
) [friend]
std::ostream& operator<< ( std::ostream &  stream,
PathName const &  name 
) [friend]

Output to stream.

bool operator<= ( PathName const &  name1,
PathName const &  name2 
) [friend]
bool operator== ( PathName const &  name1,
PathName const &  name2 
) [friend]
bool operator> ( PathName const &  name1,
PathName const &  name2 
) [friend]
bool operator>= ( PathName const &  name1,
PathName const &  name2 
) [friend]
std::istream& operator>> ( std::istream &  stream,
PathName name 
) [friend]

Input from stream.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines