Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
path Class Reference

Simple class for manipulating paths on Linux/Windows/Mac OS. More...

#include <path.h>

Public Types

enum  path_type { windows_path = 0, posix_path = 1, native_path = posix_path }
 

Public Member Functions

bool empty () const
 
bool exists () const
 
std::string extension () const
 
size_t file_size () const
 
std::string filename () const
 
bool is_absolute () const
 
bool is_directory () const
 
bool is_file () const
 
size_t length () const
 
path make_absolute () const
 
bool operator!= (const path &p) const
 
path operator/ (const path &other) const
 
pathoperator= (const path &path)
 
pathoperator= (path &&path)
 
bool operator== (const path &p) const
 
path parent_path () const
 
 path ()
 
 path (const path &path)
 
 path (path &&path)
 
 path (const char *string)
 
 path (const std::string &string)
 
bool remove_file ()
 
bool resize_file (size_t target_length)
 
void set (const std::string &str, path_type type=native_path)
 
std::string str (path_type type=native_path) const
 

Static Public Member Functions

static path getcwd ()
 

Static Protected Member Functions

static std::vector< std::string > tokenize (const std::string &string, const std::string &delim)
 

Protected Attributes

bool m_absolute
 
std::vector< std::string > m_path
 
path_type m_type
 

Friends

std::ostream & operator<< (std::ostream &os, const path &path)
 

Detailed Description

Simple class for manipulating paths on Linux/Windows/Mac OS.

This class is just a temporary workaround to avoid the heavy boost dependency until boost::filesystem is integrated into the standard template library at some point in the future.

Definition at line 42 of file path.h.

Member Enumeration Documentation

Enumerator
windows_path 
posix_path 
native_path 

Definition at line 44 of file path.h.

Constructor & Destructor Documentation

path::path ( )
inline

Definition at line 54 of file path.h.

path::path ( const path path)
inline

Definition at line 56 of file path.h.

path::path ( path &&  path)
inline

Definition at line 59 of file path.h.

path::path ( const char *  string)
inline

Definition at line 63 of file path.h.

path::path ( const std::string &  string)
inline

Definition at line 65 of file path.h.

Member Function Documentation

bool path::empty ( ) const
inline

Definition at line 74 of file path.h.

bool path::exists ( ) const
inline

Definition at line 93 of file path.h.

std::string path::extension ( ) const
inline

Definition at line 141 of file path.h.

size_t path::file_size ( ) const
inline

Definition at line 102 of file path.h.

std::string path::filename ( ) const
inline

Definition at line 149 of file path.h.

static path path::getcwd ( )
inlinestatic

Definition at line 266 of file path.h.

bool path::is_absolute ( ) const
inline

Definition at line 76 of file path.h.

bool path::is_directory ( ) const
inline

Definition at line 115 of file path.h.

bool path::is_file ( ) const
inline

Definition at line 129 of file path.h.

size_t path::length ( ) const
inline

Definition at line 72 of file path.h.

path path::make_absolute ( ) const
inline

Definition at line 78 of file path.h.

bool path::operator!= ( const path p) const
inline

Definition at line 306 of file path.h.

path path::operator/ ( const path other) const
inline

Definition at line 171 of file path.h.

path& path::operator= ( const path path)
inline

Definition at line 215 of file path.h.

path& path::operator= ( path &&  path)
inline

Definition at line 222 of file path.h.

bool path::operator== ( const path p) const
inline

Definition at line 305 of file path.h.

path path::parent_path ( ) const
inline

Definition at line 156 of file path.h.

bool path::remove_file ( )
inline

Definition at line 236 of file path.h.

bool path::resize_file ( size_t  target_length)
inline

Definition at line 244 of file path.h.

void path::set ( const std::string &  str,
path_type  type = native_path 
)
inline

Definition at line 204 of file path.h.

std::string path::str ( path_type  type = native_path) const
inline

Definition at line 185 of file path.h.

static std::vector<std::string> path::tokenize ( const std::string &  string,
const std::string &  delim 
)
inlinestaticprotected

Definition at line 309 of file path.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const path path 
)
friend

Definition at line 231 of file path.h.

Member Data Documentation

bool path::m_absolute
protected

Definition at line 328 of file path.h.

std::vector<std::string> path::m_path
protected

Definition at line 327 of file path.h.

path_type path::m_type
protected

Definition at line 326 of file path.h.


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


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:05