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

#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)
 

Detailed Description

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

Member Typedef Documentation

◆ hook_fcn_ptr

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

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

Constructor & Destructor Documentation

◆ load_path()

load_path::load_path ( interpreter interp)

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

References execute_pkg_add().

◆ ~load_path()

load_path::~load_path ( )
default

Member Function Documentation

◆ append()

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

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

◆ clear()

void load_path::clear ( )

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

◆ contains_canonical()

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().

◆ contains_file_in_dir()

bool load_path::contains_file_in_dir ( const std::string &  file_name,
const std::string &  dir_name 
)

◆ dir_list()

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

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

◆ dirs()

string_vector load_path::dirs ( ) const

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

References len.

Referenced by octave::Fpath(), and path().

◆ display()

void load_path::display ( std::ostream &  os) const

◆ execute_pkg_add()

void load_path::execute_pkg_add ( const std::string &  dir)

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

Referenced by load_path().

◆ execute_pkg_del()

void load_path::execute_pkg_del ( const std::string &  dir)

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

◆ fcn_names()

string_vector load_path::fcn_names ( ) const

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

◆ files()

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().

◆ find_all_first_of()

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().

◆ find_dir()

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().

◆ find_fcn() [1/2]

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

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

◆ find_fcn() [2/2]

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

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

◆ find_fcn_file()

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

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

◆ find_file()

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().

◆ find_first_of()

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().

◆ find_matching_dirs()

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().

◆ find_method() [1/2]

std::string 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.

◆ find_method() [2/2]

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

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

◆ find_mex_file()

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

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

◆ find_oct_file()

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

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

◆ find_package()

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

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

Referenced by cdef_manager::find_package().

◆ find_private_fcn()

std::string 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.

◆ get_add_hook()

std::function<void (const std::string&)> load_path::get_add_hook ( )
inline

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

Referenced by interpreter::initialize_load_path().

◆ get_all_package_names()

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.

◆ get_command_line_path()

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

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

Referenced by octave::Fcommand_line_path().

◆ get_remove_hook()

std::function<void (const std::string&)> load_path::get_remove_hook ( )
inline

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

◆ initialize()

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().

◆ methods()

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

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

Referenced by F__methods__().

◆ overloads()

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

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

◆ path()

std::string load_path::path ( ) const

◆ prepend()

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().

◆ read_dir_config()

void load_path::read_dir_config ( const std::string &  dir) const

◆ rehash()

void load_path::rehash ( )

◆ remove()

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().

◆ set()

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().

◆ set_add_hook()

void load_path::set_add_hook ( const std::function< void(const std::string &)> &  f)
inline

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

References f.

Referenced by interpreter::initialize_load_path().

◆ set_command_line_path()

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

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

References directory_path::path_sep_str().

◆ set_remove_hook()

void load_path::set_remove_hook ( const std::function< void(const std::string &)> &  f)
inline

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

References f.

◆ system_path()

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

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

Referenced by octave::F__pathorig__(), and octave::Frestoredefaultpath().

◆ update()

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().

Friends And Related Function Documentation

◆ get_fcn_files

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

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

Member Data Documentation

◆ M_FILE

const int load_path::M_FILE = 1
static

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

◆ MEX_FILE

const int load_path::MEX_FILE = 4
static

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

◆ OCT_FILE

const int load_path::OCT_FILE = 2
static

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


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