GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::load_path Class Reference

#include "load-path.h"

Collaboration diagram for octave::load_path:

Classes

class  dir_info
 
class  file_info
 
class  package_info
 

Public Types

typedef void(* hook_fcn_ptr) (const std::string &dir)
 

Public Member Functions

 load_path (void)
 
 load_path (const load_path &)=delete
 
 ~load_path (void)=default
 
void append (const std::string &dir, bool warn=false)
 
void clear (void)
 
bool contains_canonical (const std::string &dir_name) const
 
std::list< std::stringdir_list (void) const
 
string_vector dirs (void) const
 
void display (std::ostream &os) const
 
string_vector fcn_names (void) const
 
string_vector files (const std::string &dir, bool omit_exts=false) const
 
string_vector find_all_first_of (const string_vector &files) const
 
std::string find_dir (const std::string &dir) const
 
std::string find_fcn (const std::string &fcn, std::string &dir_name, const std::string &pack_name="")
 
std::string find_fcn (const std::string &fcn, const std::string &pack_name="")
 
std::string find_fcn_file (const std::string &fcn, const std::string &pack_name="")
 
std::string find_file (const std::string &file) const
 
std::string find_first_of (const string_vector &files) const
 
string_vector find_matching_dirs (const std::string &dir) const
 
std::string find_method (const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
 
std::string find_method (const std::string &class_name, const std::string &meth, const std::string &pack_name="")
 
std::string find_mex_file (const std::string &fcn, const std::string &pack_name="")
 
std::string find_oct_file (const std::string &fcn, const std::string &pack_name="")
 
bool find_package (const std::string &package_name) const
 
std::string find_private_fcn (const std::string &dir, const std::string &fcn, const std::string &pack_name="")
 
hook_fcn_ptr get_add_hook (void)
 
std::list< std::stringget_all_package_names (bool only_top_level=true) const
 
std::string get_command_line_path (void) const
 
hook_fcn_ptr get_remove_hook (void)
 
void initialize (bool set_initial_path=false)
 
std::list< std::stringmethods (const std::string &class_name, const std::string &pack_name="")
 
load_pathoperator= (const load_path &)=delete
 
std::list< std::stringoverloads (const std::string &meth) const
 
std::string path (void) const
 
void prepend (const std::string &dir, bool warn=false)
 
bool remove (const std::string &dir)
 
void set (const std::string &p, bool warn=false, bool is_init=false)
 
void set_add_hook (hook_fcn_ptr f)
 
void set_command_line_path (const std::string &p)
 
void set_remove_hook (hook_fcn_ptr f)
 
std::string system_path (void) const
 
void update (void) const
 

Static Public Member Functions

static void execute_pkg_add (const std::string &dir)
 
static void execute_pkg_del (const std::string &dir)
 

Private Types

typedef abs_dir_cache_type::iterator abs_dir_cache_iterator
 
typedef std::map< std::string, dir_infoabs_dir_cache_type
 
typedef abs_dir_cache_type::const_iterator const_abs_dir_cache_iterator
 
typedef dir_info_list_type::const_iterator const_dir_info_list_iterator
 
typedef fcn_map_type::const_iterator const_fcn_map_iterator
 
typedef file_info_list_type::const_iterator const_file_info_list_iterator
 
typedef method_map_type::const_iterator const_method_map_iterator
 
typedef package_map_type::const_iterator const_package_map_iterator
 
typedef private_fcn_map_type::const_iterator const_private_fcn_map_iterator
 
typedef dir_info_list_type::iterator dir_info_list_iterator
 
typedef std::list< dir_infodir_info_list_type
 
typedef fcn_map_type::iterator fcn_map_iterator
 
typedef std::map< std::string, file_info_list_typefcn_map_type
 
typedef file_info_list_type::iterator file_info_list_iterator
 
typedef std::list< file_infofile_info_list_type
 
typedef method_map_type::iterator method_map_iterator
 
typedef std::map< std::string, fcn_map_typemethod_map_type
 
typedef package_map_type::iterator package_map_iterator
 
typedef std::map< std::string, package_infopackage_map_type
 
typedef private_fcn_map_type::iterator private_fcn_map_iterator
 
typedef std::map< std::string, dir_info::fcn_file_map_typeprivate_fcn_map_type
 

Private Member Functions

void add (const std::string &dir, bool at_end, bool warn)
 
void add (const dir_info &di, bool at_end, const std::string &pname="", bool updating=false) const
 
bool contains (const std::string &dir) const
 
const_dir_info_list_iterator find_dir_info (const std::string &dir) const
 
dir_info_list_iterator find_dir_info (const std::string &dir)
 
string_vector get_file_list (const dir_info::fcn_file_map_type &lst) const
 
package_infoget_package (const std::string &name) const
 
bool is_package (const std::string &name) const
 
void move (dir_info_list_iterator i, bool at_end)
 
void move (const dir_info &di, bool at_end, const std::string &pname="")
 
void remove (const dir_info &di, const std::string &pname="")
 

Private Attributes

hook_fcn_ptr add_hook
 
dir_info_list_type dir_info_list
 
std::set< std::stringinit_dirs
 
std::string m_command_line_path
 
package_map_type package_map
 
hook_fcn_ptr remove_hook
 
package_info top_level_package
 

Static Private Attributes

static abs_dir_cache_type abs_dir_cache
 
static const int M_FILE = 1
 
static const int MEX_FILE = 4
 
static const int OCT_FILE = 2
 
static std::string sys_path
 

Friends

dir_info::fcn_file_map_type get_fcn_files (const std::string &d)
 

Detailed Description

Definition at line 41 of file load-path.h.

Member Typedef Documentation

◆ abs_dir_cache_iterator

typedef abs_dir_cache_type::iterator octave::load_path::abs_dir_cache_iterator
private

Definition at line 347 of file load-path.h.

◆ abs_dir_cache_type

Definition at line 344 of file load-path.h.

◆ const_abs_dir_cache_iterator

typedef abs_dir_cache_type::const_iterator octave::load_path::const_abs_dir_cache_iterator
private

Definition at line 346 of file load-path.h.

◆ const_dir_info_list_iterator

typedef dir_info_list_type::const_iterator octave::load_path::const_dir_info_list_iterator
private

Definition at line 341 of file load-path.h.

◆ const_fcn_map_iterator

typedef fcn_map_type::const_iterator octave::load_path::const_fcn_map_iterator
private

Definition at line 357 of file load-path.h.

◆ const_file_info_list_iterator

typedef file_info_list_type::const_iterator octave::load_path::const_file_info_list_iterator
private

Definition at line 351 of file load-path.h.

◆ const_method_map_iterator

typedef method_map_type::const_iterator octave::load_path::const_method_map_iterator
private

Definition at line 370 of file load-path.h.

◆ const_package_map_iterator

typedef package_map_type::const_iterator octave::load_path::const_package_map_iterator
private

Definition at line 496 of file load-path.h.

◆ const_private_fcn_map_iterator

typedef private_fcn_map_type::const_iterator octave::load_path::const_private_fcn_map_iterator
private

Definition at line 364 of file load-path.h.

◆ dir_info_list_iterator

typedef dir_info_list_type::iterator octave::load_path::dir_info_list_iterator
private

Definition at line 342 of file load-path.h.

◆ dir_info_list_type

Definition at line 339 of file load-path.h.

◆ fcn_map_iterator

typedef fcn_map_type::iterator octave::load_path::fcn_map_iterator
private

Definition at line 358 of file load-path.h.

◆ fcn_map_type

◆ file_info_list_iterator

typedef file_info_list_type::iterator octave::load_path::file_info_list_iterator
private

Definition at line 352 of file load-path.h.

◆ file_info_list_type

Definition at line 349 of file load-path.h.

◆ hook_fcn_ptr

typedef void(* octave::load_path::hook_fcn_ptr) (const std::string &dir)

Definition at line 53 of file load-path.h.

◆ method_map_iterator

typedef method_map_type::iterator octave::load_path::method_map_iterator
private

Definition at line 371 of file load-path.h.

◆ method_map_type

Definition at line 368 of file load-path.h.

◆ package_map_iterator

typedef package_map_type::iterator octave::load_path::package_map_iterator
private

Definition at line 497 of file load-path.h.

◆ package_map_type

◆ private_fcn_map_iterator

typedef private_fcn_map_type::iterator octave::load_path::private_fcn_map_iterator
private

Definition at line 365 of file load-path.h.

◆ private_fcn_map_type

Constructor & Destructor Documentation

◆ load_path() [1/2]

octave::load_path::load_path ( void  )
inline

Definition at line 47 of file load-path.h.

◆ load_path() [2/2]

octave::load_path::load_path ( const load_path )
delete

◆ ~load_path()

octave::load_path::~load_path ( void  )
default

Member Function Documentation

◆ add() [1/2]

◆ add() [2/2]

void octave::load_path::add ( const dir_info di,
bool  at_end,
const std::string pname = "",
bool  updating = false 
) const
private

◆ append()

void octave::load_path::append ( const std::string dir,
bool  warn = false 
)

Definition at line 308 of file load-path.cc.

References add().

Referenced by set().

◆ clear()

void octave::load_path::clear ( void  )

Definition at line 247 of file load-path.cc.

References octave::load_path::package_info::clear(), dir_info_list, package_map, and top_level_package.

Referenced by set().

◆ contains()

bool octave::load_path::contains ( const std::string dir) const
private

Definition at line 887 of file load-path.cc.

References dir_info_list, and find_dir_info().

◆ contains_canonical()

bool octave::load_path::contains_canonical ( const std::string dir_name) const

Definition at line 382 of file load-path.cc.

References d, dir_info_list, retval, and same_file().

◆ dir_list()

std::list< std::string > octave::load_path::dir_list ( void  ) const

◆ dirs()

string_vector octave::load_path::dirs ( void  ) const

Definition at line 720 of file load-path.cc.

References dir_info_list, k, and retval.

Referenced by path().

◆ display()

◆ execute_pkg_add()

void octave::load_path::execute_pkg_add ( const std::string dir)
static

Definition at line 837 of file load-path.cc.

References execute_pkg_add_or_del().

◆ execute_pkg_del()

void octave::load_path::execute_pkg_del ( const std::string dir)
static

Definition at line 843 of file load-path.cc.

References execute_pkg_add_or_del().

◆ fcn_names()

string_vector octave::load_path::fcn_names ( void  ) const

◆ files()

string_vector octave::load_path::files ( const std::string dir,
bool  omit_exts = false 
) const

Definition at line 746 of file load-path.cc.

References dir_info_list, find_dir_info(), fname, i, if(), octave_value::numel(), p, retval, and string.

◆ find_all_first_of()

◆ find_dir()

◆ find_dir_info() [1/2]

load_path::const_dir_info_list_iterator octave::load_path::find_dir_info ( const std::string dir) const
private

Definition at line 851 of file load-path.cc.

References dir_info_list, retval, string, and octave::sys::file_ops::tilde_expand().

Referenced by add(), contains(), files(), and remove().

◆ find_dir_info() [2/2]

load_path::dir_info_list_iterator octave::load_path::find_dir_info ( const std::string dir)
private

Definition at line 869 of file load-path.cc.

References dir_info_list, retval, string, and octave::sys::file_ops::tilde_expand().

◆ find_fcn() [1/2]

std::string octave::load_path::find_fcn ( const std::string fcn,
std::string dir_name,
const std::string pack_name = "" 
)
inline

◆ find_fcn() [2/2]

std::string octave::load_path::find_fcn ( const std::string fcn,
const std::string pack_name = "" 
)
inline

Definition at line 115 of file load-path.h.

References fcn, and string.

◆ find_fcn_file()

std::string octave::load_path::find_fcn_file ( const std::string fcn,
const std::string pack_name = "" 
)
inline

Definition at line 129 of file load-path.h.

References fcn, and string.

◆ find_file()

◆ find_first_of()

◆ find_matching_dirs()

◆ find_method() [1/2]

◆ find_method() [2/2]

std::string octave::load_path::find_method ( const std::string class_name,
const std::string meth,
const std::string pack_name = "" 
)
inline

Definition at line 85 of file load-path.h.

References string.

◆ find_mex_file()

std::string octave::load_path::find_mex_file ( const std::string fcn,
const std::string pack_name = "" 
)
inline

Definition at line 143 of file load-path.h.

References fcn, and string.

◆ find_oct_file()

std::string octave::load_path::find_oct_file ( const std::string fcn,
const std::string pack_name = "" 
)
inline

Definition at line 136 of file load-path.h.

References fcn, and string.

◆ find_package()

bool octave::load_path::find_package ( const std::string package_name) const
inline

Definition at line 101 of file load-path.h.

◆ find_private_fcn()

std::string octave::load_path::find_private_fcn ( const std::string dir,
const std::string fcn,
const std::string pack_name = "" 
)
inline

Definition at line 122 of file load-path.h.

References fcn.

Referenced by octave::fcn_info::fcn_info_rep::load_private_function().

◆ get_add_hook()

hook_fcn_ptr octave::load_path::get_add_hook ( void  )
inline

Definition at line 172 of file load-path.h.

◆ get_all_package_names()

std::list< std::string > octave::load_path::get_all_package_names ( bool  only_top_level = true) const

Definition at line 414 of file load-path.cc.

References package_map, and retval.

◆ get_command_line_path()

std::string octave::load_path::get_command_line_path ( void  ) const
inline

Definition at line 189 of file load-path.h.

◆ get_file_list()

string_vector octave::load_path::get_file_list ( const dir_info::fcn_file_map_type lst) const
private

Definition at line 1039 of file load-path.cc.

References MEX_FILE, nm, OCT_FILE, retval, and string.

Referenced by display(), and octave::load_path::dir_info::initialize().

◆ get_package()

package_info& octave::load_path::get_package ( const std::string name) const
inlineprivate

Definition at line 535 of file load-path.h.

References name.

Referenced by add(), move(), and remove().

◆ get_remove_hook()

hook_fcn_ptr octave::load_path::get_remove_hook ( void  )
inline

Definition at line 173 of file load-path.h.

◆ initialize()

◆ is_package()

bool octave::load_path::is_package ( const std::string name) const
private

Definition at line 1006 of file load-path.cc.

References dir_info_list, and name.

◆ methods()

std::list<std::string> octave::load_path::methods ( const std::string class_name,
const std::string pack_name = "" 
)
inline

Definition at line 93 of file load-path.h.

◆ move() [1/2]

void octave::load_path::move ( dir_info_list_iterator  i,
bool  at_end 
)
private

Definition at line 893 of file load-path.cc.

References dir_info_list, and i.

Referenced by add(), and move().

◆ move() [2/2]

void octave::load_path::move ( const dir_info di,
bool  at_end,
const std::string pname = "" 
)
private

◆ operator=()

load_path& octave::load_path::operator= ( const load_path )
delete

◆ overloads()

std::list< std::string > octave::load_path::overloads ( const std::string meth) const

◆ path()

std::string octave::load_path::path ( void  ) const

◆ prepend()

void octave::load_path::prepend ( const std::string dir,
bool  warn = false 
)

Definition at line 315 of file load-path.cc.

References add().

Referenced by set().

◆ remove() [1/2]

bool octave::load_path::remove ( const std::string dir)

◆ remove() [2/2]

void octave::load_path::remove ( const dir_info di,
const std::string pname = "" 
)
private

◆ set()

void octave::load_path::set ( const std::string p,
bool  warn = false,
bool  is_init = false 
)

◆ set_add_hook()

void octave::load_path::set_add_hook ( hook_fcn_ptr  f)
inline

Definition at line 175 of file load-path.h.

References f.

◆ set_command_line_path()

void octave::load_path::set_command_line_path ( const std::string p)
inline

Definition at line 181 of file load-path.h.

References p, and octave::directory_path::path_sep_str().

◆ set_remove_hook()

void octave::load_path::set_remove_hook ( hook_fcn_ptr  f)
inline

Definition at line 176 of file load-path.h.

References f.

◆ system_path()

std::string octave::load_path::system_path ( void  ) const
inline

Definition at line 194 of file load-path.h.

Referenced by read_mat5_binary_element(), and octave_fcn_handle::set_fcn().

◆ update()

Friends And Related Function Documentation

◆ get_fcn_files

Member Data Documentation

◆ abs_dir_cache

load_path::abs_dir_cache_type octave::load_path::abs_dir_cache
staticprivate

◆ add_hook

hook_fcn_ptr octave::load_path::add_hook
private

Definition at line 513 of file load-path.h.

Referenced by add(), and set().

◆ dir_info_list

◆ init_dirs

std::set<std::string> octave::load_path::init_dirs
mutableprivate

Definition at line 505 of file load-path.h.

Referenced by set().

◆ m_command_line_path

std::string octave::load_path::m_command_line_path
private

Definition at line 507 of file load-path.h.

Referenced by initialize().

◆ M_FILE

◆ MEX_FILE

◆ OCT_FILE

◆ package_map

package_map_type octave::load_path::package_map
mutableprivate

Definition at line 499 of file load-path.h.

Referenced by clear(), display(), get_all_package_names(), overloads(), and update().

◆ remove_hook

hook_fcn_ptr octave::load_path::remove_hook
private

Definition at line 515 of file load-path.h.

Referenced by remove().

◆ sys_path

std::string octave::load_path::sys_path
staticprivate

Definition at line 509 of file load-path.h.

Referenced by octave::load_path::package_info::add_to_fcn_map(), and initialize().

◆ top_level_package

package_info octave::load_path::top_level_package
mutableprivate

Definition at line 501 of file load-path.h.

Referenced by clear(), display(), fcn_names(), overloads(), and update().


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