GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
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 50 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 370 of file load-path.cc.

Referenced by Faddpath(), and set().

◆ clear()

void load_path::clear ( )

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

Referenced by set().

◆ contains_canonical()

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

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

References d.

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 866 of file load-path.cc.

◆ dirs()

string_vector load_path::dirs ( ) const

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

References len.

Referenced by 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 968 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 974 of file load-path.cc.

◆ fcn_names()

string_vector load_path::fcn_names ( ) const

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

◆ files()

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

◆ find_all_first_of()

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

◆ find_dir()

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

◆ find_fcn() [1/2]

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

Definition at line 113 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 107 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 127 of file load-path.h.

Referenced by fcn_file_in_path().

◆ find_file()

std::string load_path::find_file ( const std::string &  file) const

◆ find_first_of()

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

◆ find_matching_dirs()

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

◆ 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 83 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 75 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 141 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 134 of file load-path.h.

◆ find_package()

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

Definition at line 99 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 120 of file load-path.h.

◆ get_add_hook()

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

Definition at line 170 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 569 of file load-path.cc.

◆ get_command_line_path()

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

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

Referenced by Fcommand_line_path().

◆ get_remove_hook()

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

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

◆ initialize()

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

◆ methods()

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

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

Referenced by F__methods__(), and cdef_class::make_meta_class().

◆ overloads()

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

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

◆ path()

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

◆ prepend()

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

◆ read_dir_config()

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

◆ rehash()

void load_path::rehash ( )

◆ remove()

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

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

References remove(), and warning().

Referenced by Frmpath(), remove(), and update().

◆ set()

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

◆ set_add_hook()

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

Definition at line 180 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 195 of file load-path.h.

References directory_path::path_sep_str().

Referenced by interpreter::interpreter().

◆ set_remove_hook()

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

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

References f.

◆ system_path()

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

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

Referenced by F__pathorig__(), and Frestoredefaultpath().

◆ update()

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

Friends And Related Symbol Documentation

◆ get_fcn_files

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

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

Member Data Documentation

◆ M_FILE

const int load_path::M_FILE = 1
static

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

◆ MEX_FILE

const int load_path::MEX_FILE = 4
static

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

◆ OCT_FILE

const int load_path::OCT_FILE = 2
static

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


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