#include <algorithm>
#include "dir-ops.h"
#include "file-ops.h"
#include "file-stat.h"
#include "oct-env.h"
#include "pathsearch.h"
#include "singleton-cleanup.h"
#include "defaults.h"
#include "defun.h"
#include "input.h"
#include "load-path.h"
#include "pager.h"
#include "parse.h"
#include "toplev.h"
#include "unwind-prot.h"
#include "utils.h"
Go to the source code of this file.
Functions | |
DEFUN (genpath, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} genpath (@var{dir})\n\ @deftypefnx {Built-in Function} {} genpath (@var{dir}, @var{skip}, @dots{})\n\ Return a path constructed from @var{dir} and all its subdirectories.\n\ If additional string parameters are given, the resulting path will\n\ exclude directories with those names.\n\ @end deftypefn") | |
DEFUN (command_line_path,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} command_line_path (@dots{})\n\ Return the command line path variable.\n\ \n\ @seealso{path, addpath, rmpath, genpath, pathdef, savepath, pathsep}\n\ @end deftypefn") | |
DEFUN (restoredefaultpath,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} restoredefaultpath (@dots{})\n\ Restore Octave's path to its initial state at startup.\n\ \n\ @seealso{path, addpath, rmpath, genpath, pathdef, savepath, pathsep}\n\ @end deftypefn") | |
DEFUN (__pathorig__,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} __pathorig__ ()\n\ Undocumented internal function.\n\ @end deftypefn") | |
DEFUN (path, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} path (@dots{})\n\ Modify or display Octave's load path.\n\ \n\ If @var{nargin} and @var{nargout} are zero, display the elements of\n\ Octave's load path in an easy to read format.\n\ \n\ If @var{nargin} is zero and nargout is greater than zero, return the\n\ current load path.\n\ \n\ If @var{nargin} is greater than zero, concatenate the arguments,\n\ separating them with @code{pathsep}. Set the internal search path\n\ to the result and return it.\n\ \n\ No checks are made for duplicate elements.\n\ @seealso{addpath, rmpath, genpath, pathdef, savepath, pathsep}\n\ @end deftypefn") | |
DEFUN (addpath, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addpath (@var{dir1}, @dots{})\n\ @deftypefnx {Built-in Function} {} addpath (@var{dir1}, @dots{}, @var{option})\n\ Add @var{dir1}, @dots{} to the current function search path. If\n\ @var{option} is \"-begin\" or 0 (the default), prepend the\n\ directory name to the current path. If @var{option} is \"-end\"\n\ or 1, append the directory name to the current path.\n\ Directories added to the path must exist.\n\ \n\ In addition to accepting individual directory arguments, lists of\n\ directory names separated by @code{pathsep} are also accepted. For example:\n\ \n\ @example\n\ addpath (\"dir1:/dir2:~/dir3\");\n\ @end example\n\ @seealso{path, rmpath, genpath, pathdef, savepath, pathsep}\n\ @end deftypefn") | |
DEFUN (rmpath, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rmpath (@var{dir1}, @dots{})\n\ Remove @var{dir1}, @dots{} from the current function search path.\n\ \n\ In addition to accepting individual directory arguments, lists of\n\ directory names separated by @code{pathsep} are also accepted. For example:\n\ \n\ @example\n\ rmpath (\"dir1:/dir2:~/dir3\");\n\ @end example\n\ @seealso{path, addpath, genpath, pathdef, savepath, pathsep}\n\ @end deftypefn") | |
DEFUN (rehash,,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rehash ()\n\ Reinitialize Octave's load path directory cache.\n\ @end deftypefn") | |
void | execute_pkg_add (const std::string &dir) |
static void | execute_pkg_add_or_del (const std::string &dir, const std::string &script_file) |
void | execute_pkg_del (const std::string &dir) |
std::string | genpath (const std::string &dirname, const string_vector &skip) |
load_path::dir_info::fcn_file_map_type | get_fcn_files (const std::string &d) |
string_vector | get_file_list (const load_path::dir_info::fcn_file_map_type &lst) |
static bool | in_path_list (const std::string &path_list, const std::string &path) |
static void | maybe_add_path_elts (std::string &path, const std::string &dir) |
void | print_fcn_list (std::ostream &os, const load_path::dir_info::fcn_file_map_type &lst) |
void | print_types (std::ostream &os, int types) |
static void | rehash_internal (void) |
static std::list< std::string > | split_path (const std::string &p) |
static std::string | strip_trailing_separators (const std::string &dir_arg) |
DEFUN | ( | genpath | , | |
args | ||||
) |
Definition at line 1960 of file load-path.cc.
References error(), error_state, genpath(), and print_usage().
DEFUN | ( | command_line_path | ) |
Definition at line 2032 of file load-path.cc.
References load_path::get_command_line_path(), and octave_value().
DEFUN | ( | restoredefaultpath | ) |
Definition at line 2043 of file load-path.cc.
References load_path::initialize(), octave_value(), and load_path::system_path().
DEFUN | ( | __pathorig__ | ) |
Definition at line 2061 of file load-path.cc.
References octave_value(), and load_path::system_path().
DEFUN | ( | path | , | |
args | , | |||
nargout | ||||
) |
Definition at line 2070 of file load-path.cc.
References load_path::dirs(), error_state, string_vector::list_in_columns(), octave_stdout, load_path::path(), dir_path::path_sep_str(), rehash_internal(), and load_path::set().
DEFUN | ( | addpath | , | |
args | , | |||
nargout | ||||
) |
Definition at line 2126 of file load-path.cc.
References load_path::append(), arg(), error(), error_state, octave_value::int_value(), octave_value::is_numeric_type(), octave_value::is_string(), load_path::path(), load_path::prepend(), print_usage(), rehash_internal(), split_path(), and octave_value::string_value().
DEFUN | ( | rmpath | , | |
args | , | |||
nargout | ||||
) |
Definition at line 2242 of file load-path.cc.
References arg(), error(), error_state, load_path::path(), print_usage(), rehash_internal(), load_path::remove(), split_path(), and warning().
DEFUN | ( | rehash | ) |
Definition at line 2019 of file load-path.cc.
References rehash_internal().
void execute_pkg_add | ( | const std::string & | dir | ) |
Definition at line 1949 of file load-path.cc.
References execute_pkg_add_or_del().
static void execute_pkg_add_or_del | ( | const std::string & | dir, | |
const std::string & | script_file | |||
) | [static] |
Definition at line 1928 of file load-path.cc.
References file_ops::concat(), base_file_stat::exists(), input_from_startup_file, octave_interpreter_ready, unwind_protect::protect_var(), and source_file().
Referenced by execute_pkg_add(), and execute_pkg_del().
void execute_pkg_del | ( | const std::string & | dir | ) |
Definition at line 1955 of file load-path.cc.
References execute_pkg_add_or_del().
std::string genpath | ( | const std::string & | dirname, | |
const string_vector & | skip | |||
) |
Definition at line 1882 of file load-path.cc.
References file_ops::concat(), genpath(), base_file_stat::is_dir(), Array< T >::length(), dir_path::path_sep_str(), and dir_entry::read().
Referenced by DEFUN(), genpath(), maybe_add_path_elts(), and set_image_path().
load_path::dir_info::fcn_file_map_type get_fcn_files | ( | const std::string & | d | ) |
Definition at line 217 of file load-path.cc.
References dir_entry::error(), Array< T >::length(), load_path::M_FILE, load_path::MEX_FILE, load_path::OCT_FILE, dir_entry::read(), valid_identifier(), and warning().
string_vector get_file_list | ( | const load_path::dir_info::fcn_file_map_type & | lst | ) |
Definition at line 1560 of file load-path.cc.
References load_path::MEX_FILE, and load_path::OCT_FILE.
static bool in_path_list | ( | const std::string & | path_list, | |
const std::string & | path | |||
) | [static] |
Definition at line 1693 of file load-path.cc.
References dir_path::path_sep_char().
Referenced by load_path::add_to_fcn_map().
static void maybe_add_path_elts | ( | std::string & | path, | |
const std::string & | dir | |||
) | [static] |
Definition at line 475 of file load-path.cc.
References genpath(), and dir_path::path_sep_str().
Referenced by load_path::do_initialize().
void print_fcn_list | ( | std::ostream & | os, | |
const load_path::dir_info::fcn_file_map_type & | lst | |||
) |
Definition at line 1544 of file load-path.cc.
References print_types().
void print_types | ( | std::ostream & | os, | |
int | types | |||
) |
Definition at line 1516 of file load-path.cc.
References load_path::M_FILE, load_path::MEX_FILE, and load_path::OCT_FILE.
Referenced by print_fcn_list().
static void rehash_internal | ( | void | ) | [static] |
Definition at line 2008 of file load-path.cc.
References octave_time::stamp(), load_path::update(), and Vlast_prompt_time.
Referenced by DEFUN().
static std::list<std::string> split_path | ( | const std::string & | p | ) | [static] |
Definition at line 535 of file load-path.cc.
References dir_path::path_sep_char().
Referenced by DEFUN(), and load_path::do_set().
static std::string strip_trailing_separators | ( | const std::string & | dir_arg | ) | [static] |
Definition at line 618 of file load-path.cc.
References file_ops::is_dir_sep().
Referenced by load_path::do_add(), and load_path::do_remove().