#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 52 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 362 of file load-path.cc.
void load_path::clear | ( | ) |
Definition at line 298 of file load-path.cc.
bool load_path::contains_canonical | ( | const std::string & | dir_name | ) | const |
Definition at line 455 of file load-path.cc.
References d, and same_file().
Referenced by contains_file_in_dir().
bool load_path::contains_file_in_dir | ( | const std::string & | file_name, |
const std::string & | dir_name | ||
) |
Definition at line 472 of file load-path.cc.
References interpreter::chdir(), contains_canonical(), event_manager::debug_cd_or_addpath_error(), find_file(), interpreter::get_event_manager(), prepend(), and same_file().
std::list< std::string > load_path::dir_list | ( | ) | const |
Definition at line 858 of file load-path.cc.
string_vector load_path::dirs | ( | ) | const |
Definition at line 843 of file load-path.cc.
References len.
Referenced by octave::Fpath(), and path().
void load_path::display | ( | std::ostream & | os | ) | const |
Definition at line 921 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 octave::F__dump_load_path__().
void load_path::execute_pkg_add | ( | const std::string & | dir | ) |
Definition at line 960 of file load-path.cc.
Referenced by load_path().
void load_path::execute_pkg_del | ( | const std::string & | dir | ) |
Definition at line 966 of file load-path.cc.
string_vector load_path::fcn_names | ( | ) | const |
Definition at line 897 of file load-path.cc.
string_vector load_path::files | ( | const std::string & | dir, |
bool | omit_exts = false |
||
) | const |
Definition at line 869 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 779 of file load-path.cc.
References dir_sep_chars(), and string_vector::numel().
std::string load_path::find_dir | ( | const std::string & | dir | ) | const |
Definition at line 624 of file load-path.cc.
References dir_sep_chars().
Referenced by octave::contents_file_in_path(), and octave::Fdir_in_loadpath().
|
inline |
Definition at line 115 of file load-path.h.
|
inline |
Definition at line 109 of file load-path.h.
|
inline |
Definition at line 129 of file load-path.h.
std::string load_path::find_file | ( | const std::string & | file | ) | const |
Definition at line 575 of file load-path.cc.
Referenced by contains_file_in_dir(), and tree_evaluator::lookup_autoload().
std::string load_path::find_first_of | ( | const string_vector & | files | ) | const |
Definition at line 706 of file load-path.cc.
References dir_sep_chars(), and string_vector::numel().
string_vector load_path::find_matching_dirs | ( | const std::string & | dir | ) | const |
Definition at line 665 of file load-path.cc.
References dir_sep_chars().
Referenced by octave::Fdir_in_loadpath().
|
inline |
Definition at line 85 of file load-path.h.
|
inline |
Definition at line 77 of file load-path.h.
|
inline |
Definition at line 143 of file load-path.h.
|
inline |
Definition at line 136 of file load-path.h.
|
inline |
Definition at line 101 of file load-path.h.
Referenced by cdef_manager::find_package().
|
inline |
Definition at line 122 of file load-path.h.
|
inline |
Definition at line 172 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 561 of file load-path.cc.
|
inline |
Definition at line 205 of file load-path.h.
Referenced by octave::Fcommand_line_path().
|
inline |
Definition at line 177 of file load-path.h.
void load_path::initialize | ( | bool | set_initial_path = false | ) |
Definition at line 260 of file load-path.cc.
Referenced by octave::Frestoredefaultpath(), and interpreter::initialize_load_path().
|
inline |
Definition at line 93 of file load-path.h.
Referenced by F__methods__().
std::list< std::string > load_path::overloads | ( | const std::string & | meth | ) | const |
Definition at line 546 of file load-path.cc.
std::string load_path::path | ( | ) | const |
Definition at line 903 of file load-path.cc.
References dirs(), len, string_vector::numel(), and directory_path::path_sep_str().
Referenced by octave::Faddpath(), octave::Fpath(), and octave::Frmpath().
void load_path::prepend | ( | const std::string & | dir, |
bool | warn = false |
||
) |
Definition at line 369 of file load-path.cc.
Referenced by contains_file_in_dir().
void load_path::read_dir_config | ( | const std::string & | dir | ) | const |
Definition at line 1162 of file load-path.cc.
References __get_input_system__(), octave::sys::canonicalize_file_name(), dir_sep_str(), fgets(), fopen(), and input_system::set_dir_encoding().
Referenced by interpreter::chdir().
void load_path::rehash | ( | ) |
Definition at line 972 of file load-path.cc.
References interpreter::get_event_manager(), update(), event_manager::update_path_dialog(), and Vlast_prompt_time.
Referenced by octave::Fpath(), and octave::Frehash().
bool load_path::remove | ( | const std::string & | dir | ) |
Definition at line 376 of file load-path.cc.
References same_file(), octave::sys::file_ops::tilde_expand(), and warning().
Referenced by update().
void load_path::set | ( | const std::string & | p, |
bool | warn = false , |
||
bool | is_init = false |
||
) |
Definition at line 308 of file load-path.cc.
Referenced by octave::Fpath().
|
inline |
Definition at line 182 of file load-path.h.
References f.
Referenced by interpreter::initialize_load_path().
|
inline |
Definition at line 197 of file load-path.h.
References directory_path::path_sep_str().
|
inline |
Definition at line 187 of file load-path.h.
References f.
|
inline |
Definition at line 210 of file load-path.h.
Referenced by octave::F__pathorig__(), and octave::Frestoredefaultpath().
void load_path::update | ( | ) |
Definition at line 417 of file load-path.cc.
References remove(), and warning_with_id().
Referenced by interpreter::chdir(), and rehash().
|
friend |
Definition at line 1332 of file load-path.cc.
|
static |
Definition at line 214 of file load-path.h.
|
static |
Definition at line 216 of file load-path.h.
|
static |
Definition at line 215 of file load-path.h.