#include "load-path.h"
Public Types | |
typedef void(* | hook_fcn_ptr) (const std::string &dir) |
Public Member Functions | |
load_path (interpreter &interp) | |
~load_path ()=default | |
void | append (const std::string &dir, bool warn=false) |
void | clear () |
bool | contains_canonical (const std::string &dir_name) const |
bool | contains_file_in_dir (const std::string &file_name, const std::string &dir_name) |
std::list< std::string > | dir_list () const |
string_vector | dirs () const |
void | display (std::ostream &os) const |
void | execute_pkg_add (const std::string &dir) |
void | execute_pkg_del (const std::string &dir) |
string_vector | fcn_names () 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, const std::string &pack_name="") |
std::string | find_fcn (const std::string &fcn, std::string &dir_name, 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, const std::string &pack_name="") |
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_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="") |
std::function< void(const std::string &)> | get_add_hook () |
std::list< std::string > | get_all_package_names (bool only_top_level=true) const |
std::string | get_command_line_path () const |
std::function< void(const std::string &)> | get_remove_hook () |
void | initialize (bool set_initial_path=false) |
std::list< std::string > | methods (const std::string &class_name, const std::string &pack_name="") |
std::list< std::string > | overloads (const std::string &meth) const |
std::string | path () const |
void | prepend (const std::string &dir, bool warn=false) |
void | read_dir_config (const std::string &dir) const |
void | rehash () |
bool | remove (const std::string &dir) |
void | set (const std::string &p, bool warn=false, bool is_init=false) |
void | set_add_hook (const std::function< void(const std::string &)> &f) |
void | set_command_line_path (const std::string &p) |
void | set_remove_hook (const std::function< void(const std::string &)> &f) |
std::string | system_path () const |
void | update () |
Static Public Attributes | |
static const int | M_FILE = 1 |
static const int | MEX_FILE = 4 |
static const int | OCT_FILE = 2 |
Friends | |
dir_info::fcn_file_map_type | get_fcn_files (const std::string &d) |
Definition at line 44 of file load-path.h.
typedef void(* load_path::hook_fcn_ptr) (const std::string &dir) |
Definition at line 50 of file load-path.h.
load_path::load_path | ( | interpreter & | interp | ) |
Definition at line 252 of file load-path.cc.
References execute_pkg_add().
|
default |
void load_path::append | ( | const std::string & | dir, |
bool | warn = false |
||
) |
Definition at line 370 of file load-path.cc.
Referenced by Faddpath(), and set().
void load_path::clear | ( | ) |
Definition at line 298 of file load-path.cc.
Referenced by set().
bool load_path::contains_canonical | ( | const std::string & | dir_name | ) | const |
bool load_path::contains_file_in_dir | ( | const std::string & | file_name, |
const std::string & | dir_name | ||
) |
Definition at line 480 of file load-path.cc.
References interpreter::chdir(), contains_canonical(), event_manager::debug_cd_or_addpath_error(), find_file(), interpreter::get_event_manager(), and prepend().
std::list< std::string > load_path::dir_list | ( | ) | const |
Definition at line 866 of file load-path.cc.
string_vector load_path::dirs | ( | ) | const |
void load_path::display | ( | std::ostream & | os | ) | const |
Definition at line 929 of file load-path.cc.
References string_vector::empty(), string_vector::list_in_columns(), and load_path::dir_info::class_info::method_file_map.
Referenced by F__dump_load_path__().
void load_path::execute_pkg_add | ( | const std::string & | dir | ) |
Definition at line 968 of file load-path.cc.
Referenced by load_path().
void load_path::execute_pkg_del | ( | const std::string & | dir | ) |
Definition at line 974 of file load-path.cc.
string_vector load_path::fcn_names | ( | ) | const |
Definition at line 905 of file load-path.cc.
string_vector load_path::files | ( | const std::string & | dir, |
bool | omit_exts = false |
||
) | const |
Definition at line 877 of file load-path.cc.
References len, and string_vector::numel().
string_vector load_path::find_all_first_of | ( | const string_vector & | files | ) | const |
Definition at line 787 of file load-path.cc.
References len, string_vector::numel(), and string_vector::resize().
Referenced by Ffile_in_loadpath().
std::string load_path::find_dir | ( | const std::string & | dir | ) | const |
Definition at line 632 of file load-path.cc.
Referenced by contents_file_in_path(), and Fdir_in_loadpath().
|
inline |
Definition at line 113 of file load-path.h.
|
inline |
Definition at line 107 of file load-path.h.
|
inline |
Definition at line 127 of file load-path.h.
Referenced by fcn_file_in_path().
std::string load_path::find_file | ( | const std::string & | file | ) | const |
Definition at line 583 of file load-path.cc.
References len, and string_vector::numel().
Referenced by contains_file_in_dir(), file_in_path(), find_data_file_in_load_path(), and tree_evaluator::lookup_autoload().
std::string load_path::find_first_of | ( | const string_vector & | files | ) | const |
Definition at line 714 of file load-path.cc.
References len, string_vector::numel(), and string_vector::resize().
Referenced by Ffile_in_loadpath().
string_vector load_path::find_matching_dirs | ( | const std::string & | dir | ) | const |
Definition at line 673 of file load-path.cc.
Referenced by Fdir_in_loadpath().
|
inline |
Definition at line 83 of file load-path.h.
|
inline |
Definition at line 75 of file load-path.h.
|
inline |
Definition at line 141 of file load-path.h.
|
inline |
Definition at line 134 of file load-path.h.
|
inline |
Definition at line 99 of file load-path.h.
Referenced by cdef_manager::find_package().
|
inline |
Definition at line 120 of file load-path.h.
|
inline |
Definition at line 170 of file load-path.h.
Referenced by interpreter::initialize_load_path().
std::list< std::string > load_path::get_all_package_names | ( | bool | only_top_level = true | ) | const |
Definition at line 569 of file load-path.cc.
|
inline |
Definition at line 203 of file load-path.h.
Referenced by Fcommand_line_path().
|
inline |
Definition at line 175 of file load-path.h.
void load_path::initialize | ( | bool | set_initial_path = false | ) |
Definition at line 260 of file load-path.cc.
References directory_path::path_sep_str(), and set().
Referenced by Frestoredefaultpath(), and interpreter::initialize_load_path().
|
inline |
Definition at line 91 of file load-path.h.
Referenced by F__methods__(), and cdef_class::make_meta_class().
std::list< std::string > load_path::overloads | ( | const std::string & | meth | ) | const |
Definition at line 554 of file load-path.cc.
std::string load_path::path | ( | ) | const |
Definition at line 911 of file load-path.cc.
References dirs(), len, string_vector::numel(), and directory_path::path_sep_str().
Referenced by Faddpath(), Fpath(), and Frmpath().
void load_path::prepend | ( | const std::string & | dir, |
bool | warn = false |
||
) |
Definition at line 377 of file load-path.cc.
Referenced by contains_file_in_dir(), Faddpath(), and set().
void load_path::read_dir_config | ( | const std::string & | dir | ) | const |
Definition at line 1171 of file load-path.cc.
References __get_input_system__(), fgets(), and input_system::set_dir_encoding().
Referenced by interpreter::chdir().
void load_path::rehash | ( | ) |
Definition at line 980 of file load-path.cc.
References interpreter::get_event_manager(), update(), event_manager::update_path_dialog(), and Vlast_prompt_time.
Referenced by Faddpath(), Fpath(), Frehash(), and Frmpath().
bool load_path::remove | ( | const std::string & | dir | ) |
Definition at line 308 of file load-path.cc.
References append(), clear(), prepend(), action_container::protect_var(), unwind_protect::run_first(), and warning_with_id().
Referenced by Fpath(), and initialize().
|
inline |
Definition at line 180 of file load-path.h.
References f.
Referenced by interpreter::initialize_load_path().
|
inline |
Definition at line 195 of file load-path.h.
References directory_path::path_sep_str().
Referenced by interpreter::interpreter().
|
inline |
Definition at line 185 of file load-path.h.
References f.
|
inline |
Definition at line 208 of file load-path.h.
Referenced by F__pathorig__(), and Frestoredefaultpath().
void load_path::update | ( | ) |
Definition at line 425 of file load-path.cc.
References remove(), and warning_with_id().
Referenced by interpreter::chdir(), and rehash().
|
friend |
Definition at line 1341 of file load-path.cc.
|
static |
Definition at line 212 of file load-path.h.
|
static |
Definition at line 214 of file load-path.h.
|
static |
Definition at line 213 of file load-path.h.