GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
load_path Class Reference

#include "load-path.h"

Collaboration diagram for load_path:
Collaboration graph
[legend]

Classes

class  dir_info
 
class  file_info
 
class  loader
 

Public Types

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

Public Member Functions

 ~load_path (void)
 

Static Public Member Functions

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

Protected Member Functions

 load_path (void)
 

Private Types

typedef
abs_dir_cache_type::iterator 
abs_dir_cache_iterator
 
typedef std::map< std::string,
dir_info
abs_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
loader_map_type::const_iterator 
const_loader_map_iterator
 
typedef
method_map_type::const_iterator 
const_method_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_type
fcn_map_type
 
typedef
file_info_list_type::iterator 
file_info_list_iterator
 
typedef std::list< file_infofile_info_list_type
 
typedef loader_map_type::iterator loader_map_iterator
 
typedef std::map< std::string,
loader
loader_map_type
 
typedef method_map_type::iterator method_map_iterator
 
typedef std::map< std::string,
fcn_map_type
method_map_type
 
typedef
private_fcn_map_type::iterator 
private_fcn_map_iterator
 
typedef std::map< std::string,
dir_info::fcn_file_map_type
private_fcn_map_type
 

Private Member Functions

void add (const dir_info &di, bool at_end, const std::string &pname="", bool updating=false) const
 
bool contains (const std::string &dir) const
 
void do_add (const std::string &dir, bool at_end, bool warn)
 
void do_append (const std::string &dir, bool warn)
 
void do_clear (void)
 
bool do_contains_canonical (const std::string &dir) const
 
std::list< std::stringdo_dir_list (void) const
 
string_vector do_dirs (void) const
 
void do_display (std::ostream &os) const
 
string_vector do_fcn_names (void) const
 
string_vector do_files (const std::string &dir, bool omit_exts) const
 
string_vector do_find_all_first_of (const string_vector &files) const
 
std::string do_find_dir (const std::string &dir) const
 
std::string do_find_file (const std::string &file) const
 
std::string do_find_first_of (const string_vector &files) const
 
string_vector do_find_matching_dirs (const std::string &dir) const
 
bool do_find_package (const std::string &package_name) const
 
std::list< std::stringdo_get_all_package_names (bool only_top_level) const
 
std::string do_get_command_line_path (void) const
 
void do_initialize (bool set_initial_path)
 
void do_move (dir_info_list_iterator i, bool at_end)
 
std::list< std::stringdo_overloads (const std::string &meth) const
 
std::string do_path (void) const
 
void do_prepend (const std::string &dir, bool warn)
 
bool do_remove (const std::string &dir)
 
void do_set (const std::string &p, bool warn, bool is_init=false)
 
std::string do_system_path (void) const
 
void do_update (void) 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)
 
loaderget_loader (const std::string &name) const
 
bool is_package (const std::string &name) const
 
void move (const dir_info &di, bool at_end, const std::string &pname="")
 
void remove (const dir_info &di, const std::string &pname="")
 

Static Private Member Functions

static bool check_file_type (std::string &fname, int type, int possible_types, const std::string &fcn, const char *who)
 
static void cleanup_instance (void)
 
static bool instance_ok (void)
 

Private Attributes

loader default_loader
 
dir_info_list_type dir_info_list
 
std::set< std::stringinit_dirs
 
loader_map_type loader_map
 

Static Private Attributes

static abs_dir_cache_type abs_dir_cache
 
static hook_fcn_ptr add_hook = load_path::execute_pkg_add
 
static std::string command_line_path
 
static load_pathinstance = 0
 
static const int M_FILE = 1
 
static const int MEX_FILE = 4
 
static const int OCT_FILE = 2
 
static hook_fcn_ptr remove_hook = load_path::execute_pkg_del
 
static std::string sys_path
 

Friends

dir_info::fcn_file_map_type get_fcn_files (const std::string &d)
 
string_vector get_file_list (const dir_info::fcn_file_map_type &lst)
 
void print_fcn_list (std::ostream &os, const dir_info::fcn_file_map_type &lst)
 
void print_types (std::ostream &os, int types)
 

Detailed Description

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

Member Typedef Documentation

typedef abs_dir_cache_type::iterator load_path::abs_dir_cache_iterator
private

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

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

typedef abs_dir_cache_type::const_iterator load_path::const_abs_dir_cache_iterator
private

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

typedef dir_info_list_type::const_iterator load_path::const_dir_info_list_iterator
private

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

typedef fcn_map_type::const_iterator load_path::const_fcn_map_iterator
private

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

typedef file_info_list_type::const_iterator load_path::const_file_info_list_iterator
private

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

typedef loader_map_type::const_iterator load_path::const_loader_map_iterator
private

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

typedef method_map_type::const_iterator load_path::const_method_map_iterator
private

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

typedef private_fcn_map_type::const_iterator load_path::const_private_fcn_map_iterator
private

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

typedef dir_info_list_type::iterator load_path::dir_info_list_iterator
private

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

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

typedef fcn_map_type::iterator load_path::fcn_map_iterator
private

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

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

typedef file_info_list_type::iterator load_path::file_info_list_iterator
private

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

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

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

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

typedef loader_map_type::iterator load_path::loader_map_iterator
private

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

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

typedef method_map_type::iterator load_path::method_map_iterator
private

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

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

typedef private_fcn_map_type::iterator load_path::private_fcn_map_iterator
private

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

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

Constructor & Destructor Documentation

load_path::load_path ( void  )
inlineprotected

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

Referenced by instance_ok().

load_path::~load_path ( void  )
inline

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

Member Function Documentation

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

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

References load_path::loader::add(), get_loader(), p, load_path::dir_info::package_dir_map, and string.

Referenced by do_add(), and do_update().

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

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

bool load_path::check_file_type ( std::string fname,
int  type,
int  possible_types,
const std::string fcn,
const char *  who 
)
staticprivate
static void load_path::cleanup_instance ( void  )
inlinestaticprivate

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

Referenced by instance_ok().

static void load_path::clear ( void  )
inlinestatic

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

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

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

References dir_info_list, and find_dir_info().

static bool load_path::contains_canonical ( const std::string dir_name)
inlinestatic

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

static std::list<std::string> load_path::dir_list ( void  )
inlinestatic
static string_vector load_path::dirs ( void  )
inlinestatic

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

Referenced by do_path().

static void load_path::display ( std::ostream &  os)
inlinestatic

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

void load_path::do_add ( const std::string dir,
bool  at_end,
bool  warn 
)
private
void load_path::do_append ( const std::string dir,
bool  warn 
)
private

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

References do_add().

Referenced by do_set().

void load_path::do_clear ( void  )
private

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

References load_path::loader::clear(), default_loader, dir_info_list, and loader_map.

Referenced by do_set().

bool load_path::do_contains_canonical ( const std::string dir) const
private

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

References dir_info_list, retval, and same_file().

std::list< std::string > load_path::do_dir_list ( void  ) const
private

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

References dir_info_list, and retval.

string_vector load_path::do_dirs ( void  ) const
private

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

References dir_info_list, k, and retval.

void load_path::do_display ( std::ostream &  os) const
private
string_vector load_path::do_fcn_names ( void  ) const
private

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

References default_loader, and load_path::loader::fcn_names().

string_vector load_path::do_files ( const std::string dir,
bool  omit_exts 
) const
private

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

References dir_info_list, find_dir_info(), fname, if(), Array< T >::numel(), p, retval, and string.

string_vector load_path::do_find_all_first_of ( const string_vector files) const
private
std::string load_path::do_find_dir ( const std::string dir) const
private
std::string load_path::do_find_file ( const std::string file) const
private
std::string load_path::do_find_first_of ( const string_vector files) const
private
string_vector load_path::do_find_matching_dirs ( const std::string dir) const
private
bool load_path::do_find_package ( const std::string package_name) const
inlineprivate

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

std::list< std::string > load_path::do_get_all_package_names ( bool  only_top_level) const
private

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

References loader_map, and retval.

std::string load_path::do_get_command_line_path ( void  ) const
inlineprivate

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

void load_path::do_initialize ( bool  set_initial_path)
private
void load_path::do_move ( dir_info_list_iterator  i,
bool  at_end 
)
private

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

References dir_info_list, and move().

Referenced by do_add().

std::list< std::string > load_path::do_overloads ( const std::string meth) const
private

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

References default_loader, loader_map, load_path::loader::overloads(), and retval.

std::string load_path::do_path ( void  ) const
private
void load_path::do_prepend ( const std::string dir,
bool  warn 
)
private

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

References do_add().

Referenced by do_set().

bool load_path::do_remove ( const std::string dir)
private
void load_path::do_set ( const std::string p,
bool  warn,
bool  is_init = false 
)
private
std::string load_path::do_system_path ( void  ) const
inlineprivate

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

void load_path::do_update ( void  ) const
private
void load_path::execute_pkg_add ( const std::string dir)
static

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

References execute_pkg_add_or_del().

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

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

References execute_pkg_add_or_del().

static string_vector load_path::fcn_names ( void  )
inlinestatic

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

Referenced by make_name_list().

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

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

static string_vector load_path::find_all_first_of ( const string_vector files)
inlinestatic

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

static std::string load_path::find_dir ( const std::string dir)
inlinestatic

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

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

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

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

Referenced by contains(), do_add(), do_files(), and do_remove().

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

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

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

static std::string load_path::find_fcn ( const std::string fcn,
std::string dir_name,
const std::string pack_name = "" 
)
inlinestatic
static std::string load_path::find_fcn ( const std::string fcn,
const std::string pack_name = "" 
)
inlinestatic

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

References string.

static std::string load_path::find_fcn_file ( const std::string fcn,
const std::string pack_name = "" 
)
inlinestatic

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

References string.

static std::string load_path::find_file ( const std::string file)
inlinestatic

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

Referenced by lookup_autoload().

static std::string load_path::find_first_of ( const string_vector files)
inlinestatic

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

static string_vector load_path::find_matching_dirs ( const std::string dir)
inlinestatic

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

static std::string load_path::find_method ( const std::string class_name,
const std::string meth,
std::string dir_name,
const std::string pack_name = "" 
)
inlinestatic
static std::string load_path::find_method ( const std::string class_name,
const std::string meth,
const std::string pack_name = "" 
)
inlinestatic

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

References string.

static std::string load_path::find_mex_file ( const std::string fcn,
const std::string pack_name = "" 
)
inlinestatic

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

References string.

static std::string load_path::find_oct_file ( const std::string fcn,
const std::string pack_name = "" 
)
inlinestatic

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

References string.

static bool load_path::find_package ( const std::string package_name)
inlinestatic

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

Referenced by cdef_manager::do_find_package().

static std::string load_path::find_private_fcn ( const std::string dir,
const std::string fcn,
const std::string pack_name = "" 
)
inlinestatic
static hook_fcn_ptr load_path::get_add_hook ( void  )
inlinestatic

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

static std::list<std::string> load_path::get_all_package_names ( bool  only_top_level = true)
inlinestatic

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

Referenced by package_getAllPackages().

static std::string load_path::get_command_line_path ( void  )
inlinestatic

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

loader& load_path::get_loader ( const std::string name) const
inlineprivate

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

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

static hook_fcn_ptr load_path::get_remove_hook ( void  )
inlinestatic

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

static void load_path::initialize ( bool  set_initial_path = false)
inlinestatic

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

Referenced by F__pathorig__().

bool load_path::instance_ok ( void  )
staticprivate
bool load_path::is_package ( const std::string name) const
private

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

References dir_info_list, and p.

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

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

Referenced by cdef_class::make_meta_class().

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

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

References get_loader(), load_path::loader::move(), p, load_path::dir_info::package_dir_map, and string.

Referenced by do_move().

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

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

Referenced by make_fcn_handle().

static std::string load_path::path ( void  )
inlinestatic

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

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

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

static bool load_path::remove ( const std::string dir)
inlinestatic

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

void load_path::remove ( const dir_info di,
const std::string pname = "" 
)
private
static void load_path::set ( const std::string p,
bool  warn = false 
)
inlinestatic

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

static void load_path::set_add_hook ( hook_fcn_ptr  f)
inlinestatic

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

References f.

static void load_path::set_command_line_path ( const std::string p)
inlinestatic

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

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

static void load_path::set_remove_hook ( hook_fcn_ptr  f)
inlinestatic

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

References f.

static std::string load_path::system_path ( void  )
inlinestatic
static void load_path::update ( void  )
inlinestatic

Friends And Related Function Documentation

dir_info::fcn_file_map_type get_fcn_files ( const std::string d)
friend
string_vector get_file_list ( const dir_info::fcn_file_map_type lst)
friend

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

Referenced by do_display(), and load_path::dir_info::initialize().

void print_fcn_list ( std::ostream &  os,
const dir_info::fcn_file_map_type lst 
)
friend

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

Referenced by load_path::loader::display().

void print_types ( std::ostream &  os,
int  types 
)
friend

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

Referenced by load_path::loader::display(), and print_fcn_list().

Member Data Documentation

load_path::abs_dir_cache_type load_path::abs_dir_cache
staticprivate

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

Referenced by load_path::dir_info::initialize(), and load_path::dir_info::update().

load_path::hook_fcn_ptr load_path::add_hook = load_path::execute_pkg_add
staticprivate

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

Referenced by do_add(), and do_set().

std::string load_path::command_line_path
staticprivate

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

Referenced by do_initialize().

loader load_path::default_loader
mutableprivate

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

Referenced by do_clear(), do_display(), do_fcn_names(), do_overloads(), and do_update().

dir_info_list_type load_path::dir_info_list
mutableprivate
std::set<std::string> load_path::init_dirs
mutableprivate

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

Referenced by do_set().

load_path * load_path::instance = 0
staticprivate

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

Referenced by instance_ok().

loader_map_type load_path::loader_map
mutableprivate

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

Referenced by do_clear(), do_display(), do_get_all_package_names(), do_overloads(), and do_update().

const int load_path::M_FILE = 1
staticprivate
const int load_path::MEX_FILE = 4
staticprivate
const int load_path::OCT_FILE = 2
staticprivate
load_path::hook_fcn_ptr load_path::remove_hook = load_path::execute_pkg_del
staticprivate

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

Referenced by do_remove().

std::string load_path::sys_path
staticprivate

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

Referenced by load_path::loader::add_to_fcn_map(), and do_initialize().


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