ardour
Public Member Functions | Protected Member Functions | List of all members
PBD::Searchpath Class Reference

#include <search_path.h>

Inheritance diagram for PBD::Searchpath:

Public Member Functions

LIBPBD_TEMPLATE_MEMBER_API Searchpath ()
 
LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::string &search_path)
 
LIBPBD_TEMPLATE_MEMBER_API Searchpath (const std::vector< std::string > &paths)
 
LIBPBD_TEMPLATE_MEMBER_API ~Searchpath ()
 
LIBPBD_TEMPLATE_MEMBER_API
const std::string 
to_string () const
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator+= (const Searchpath &spath)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator+= (const std::string &directory_path)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator+ (const Searchpath &other)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator+ (const std::string &directory_path)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator-= (const Searchpath &spath)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
operator-= (const std::string &directory_path)
 
LIBPBD_TEMPLATE_MEMBER_API
Searchpath
add_subdirectory_to_paths (const std::string &subdir)
 

Protected Member Functions

LIBPBD_TEMPLATE_MEMBER_API void add_directory (const std::string &directory_path)
 
LIBPBD_TEMPLATE_MEMBER_API void add_directories (const std::vector< std::string > &paths)
 
LIBPBD_TEMPLATE_MEMBER_API void remove_directory (const std::string &directory_path)
 
LIBPBD_TEMPLATE_MEMBER_API void remove_directories (const std::vector< std::string > &paths)
 

Detailed Description

The Searchpath class is a helper class for getting a vector of paths contained in a search path string where a "search path string" contains absolute directory paths separated by a colon(:) or a semi-colon(;) on windows.

The Searchpath class does not test whether the paths exist or are directories. It is basically just a container.

Definition at line 41 of file search_path.h.

Constructor & Destructor Documentation

PBD::Searchpath::Searchpath ( )

Create an empty Searchpath.

Definition at line 33 of file search_path.cc.

LIBPBD_TEMPLATE_MEMBER_API PBD::Searchpath::Searchpath ( const std::string &  search_path)

Initialize Searchpath from a string where the string contains one or more absolute paths to directories which are delimited by a path separation character. The path delimeter is a colon(:) on unix and a semi-colon(;) on windows.

Each path contained in the search path may or may not resolve to an existing directory in the filesystem.

Parameters
search_pathA path string.
PBD::Searchpath::Searchpath ( const std::vector< std::string > &  paths)

Initialize Searchpath from a vector of paths that may or may not exist.

Parameters
pathsA vector of paths.

Definition at line 47 of file search_path.cc.

LIBPBD_TEMPLATE_MEMBER_API PBD::Searchpath::~Searchpath ( )
inline

Definition at line 70 of file search_path.h.

Member Function Documentation

void PBD::Searchpath::add_directories ( const std::vector< std::string > &  paths)
protected

Definition at line 91 of file search_path.cc.

void PBD::Searchpath::add_directory ( const std::string &  directory_path)
protected

Definition at line 77 of file search_path.cc.

Searchpath & PBD::Searchpath::add_subdirectory_to_paths ( const std::string &  subdir)

Add a sub-directory to each path in the search path.

Parameters
subdirThe directory name, it should not contain any path separating tokens.

Definition at line 158 of file search_path.cc.

Searchpath & PBD::Searchpath::operator+ ( const Searchpath other)

Concatenate another Searchpath onto this.

Definition at line 135 of file search_path.cc.

Searchpath & PBD::Searchpath::operator+ ( const std::string &  directory_path)

Add another path to the search path.

Definition at line 128 of file search_path.cc.

Searchpath & PBD::Searchpath::operator+= ( const Searchpath spath)

Add all the directories in path to this.

Definition at line 114 of file search_path.cc.

Searchpath & PBD::Searchpath::operator+= ( const std::string &  directory_path)

Add another directory path to the search path.

Definition at line 121 of file search_path.cc.

Searchpath & PBD::Searchpath::operator-= ( const Searchpath spath)

Remove all the directories in path from this.

Definition at line 143 of file search_path.cc.

Searchpath & PBD::Searchpath::operator-= ( const std::string &  directory_path)

Remove a directory path from the search path.

Definition at line 150 of file search_path.cc.

void PBD::Searchpath::remove_directories ( const std::vector< std::string > &  paths)
protected

Definition at line 69 of file search_path.cc.

void PBD::Searchpath::remove_directory ( const std::string &  directory_path)
protected

Definition at line 53 of file search_path.cc.

const string PBD::Searchpath::to_string ( ) const
Returns
a search path string.

The string that is returned contains the platform specific path separator.

Definition at line 99 of file search_path.cc.


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