jubilant-funicular
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
utils::Path Class Reference

A (case-sensitive) Path in a file system. More...

#include <Path.h>

Collaboration diagram for utils::Path:
Collaboration graph
[legend]

Classes

class  iterator
 
class  SetBeginEndKey
 Key unlocking the set_{begin,end}() "private" functions of class Path::iterator. More...
 

Public Member Functions

 Path (const std::string &path)
 
 Path (const char *p)
 
Path resolve () const
 Returns an absolute path equivalent to this.
 
Path parent () const
 Returns the folder containing this path.
 
std::string file_name (bool extension=true) const
 
bool exists () const
 
bool empty () const
 
bool is_empty () const
 
bool is_file () const
 
bool is_directory () const
 
bool is_folder () const
 
bool is_relative () const
 
bool is_absolute () const
 
const std::string & to_string () const
 
Pathoperator= (const char *p)
 
Pathoperator= (const std::string &p)
 
bool operator== (const char *p) const
 
bool operator== (const Path &p) const
 
bool operator== (const std::string &p) const
 
bool operator!= (const char *p) const
 
bool operator!= (const Path &p) const
 
bool operator!= (const std::string &p) const
 
bool operator< (const Path &p) const
 
bool operator<= (const Path &p) const
 
Path operator+ (const char *p) const
 
Pathoperator+= (const char *p)
 
Path operator+ (const std::string &p) const
 
Pathoperator+= (const std::string &p)
 
Path operator+ (const Path &p) const
 
Pathoperator+= (const Path &p)
 
Path::iterator begin () const
 
Path::iterator end () const
 

Static Public Member Functions

static Path cwd ()
 Returns Path representing the current working directory.
 

Private Attributes

std::string m_path
 

Detailed Description

A (case-sensitive) Path in a file system.

Definition at line 16 of file Path.h.

Member Function Documentation

◆ file_name()

string utils::Path::file_name ( bool  extension = true) const

Returns the last component (file or directory) name of the path

When extension=false, the extension is dropped from the returned string

Definition at line 62 of file Path.cpp.


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