26#if defined (HAVE_CONFIG_H)
64 if (canonical_dir.empty ())
70 if (! is_absolute_path)
75 if (dir.compare (0, cwd.length (), cwd) == 0)
76 dir.erase (0, cwd.length ()+1);
95 path += directory_path::path_sep_str () + tpath;
99 static std::list<std::string>
102 std::list<std::string> retval;
105 std::size_t end = p.find (directory_path::path_sep_char ());
107 std::size_t
len = p.length ();
109 while (end != std::string::npos)
111 std::string elt = p.substr (beg, end-beg);
114 retval.push_back (elt);
121 end = p.find (directory_path::path_sep_char (), beg);
124 std::string elt = p.substr (beg);
127 retval.push_back (elt);
137 std::string dir = dir_arg;
139 std::size_t k = dir.length ();
144 if (k < dir.length ())
171 std::string dir_name = curr_code->
dir_name ();
173 if (! dir_name.empty ())
179 sys::file_stat fs (pfname);
181 if (fs.exists () && fs.is_reg ())
194 std::size_t ps =
path.size ();
195 std::size_t pls = path_list.size ();
196 std::size_t pos = path_list.find (
path);
197 char psc = directory_path::path_sep_char ();
198 while (pos != std::string::npos)
200 if ((pos == 0 || path_list[pos-1] == psc)
201 && (pos + ps == pls || path_list[pos + ps] == psc))
204 pos = path_list.find (
path, pos + 1);
254 sys::dir_entry dir (
d);
264 std::string fname = flist[i];
268 sys::file_stat fs (full_name);
272 if (fs && fs.is_dir ()
273 && (fname[0] ==
'@' || fname[0] ==
'+' || fname ==
"private")
274 && ((fs.mtime () + fs.time_resolution () > last_checked)
275 || ((fname[0] ==
'@' || fname[0] ==
'+')
282 std::string msg = dir.error ();
283 warning (
"load_path: %s: %s",
d.c_str (), msg.c_str ());
294 remove_hook ([=] (
const std::string& dir) { this->
execute_pkg_del (dir); }),
295 m_interpreter (interp), m_package_map (), m_top_level_package (),
296 m_dir_info_list (), m_init_dirs (), m_command_line_path ()
304 if (set_initial_path)
320 tpath = sys::env::getenv (
"OCTAVE_PATH");
324 if (! tpath.empty ())
329 xpath += directory_path::path_sep_str () +
s_sys_path;
334 set (xpath,
false,
true);
353 for (
auto& elt : elts)
357 std::set<std::string> elts_set (elts.begin (), elts.end ());
365 if (elts_set.find (init_dir) == elts_set.end ())
368 "default load path altered. Some built-in functions may not be found. Try restoredefaultpath() to recover it.");
376 unwind_protect frame;
383 for (
const auto& elt : elts)
405 add (dir,
true, warn);
412 add (dir,
false, warn);
420 if (! dir_arg.empty ())
424 warning (R
"(rmpath: can't remove "." from path)");
469 bool ok = di.update ();
473 (
"Octave:load-path:update-failed",
474 "load-path: update failed for '%s', removing from path",
475 di.dir_name.c_str ());
477 add (di,
true,
"",
true);
500 const std::string& dir)
503 bool addpath_option =
true;
505 std::string curr_dir = sys::env::get_current_directory ();
514 std::string base_file = (file.length () > dir.length ())
515 ? file.substr (dir.length () + 1)
516 : sys::env::base_pathname (file);
518 std::string lp_file =
find_file (base_file);
520 if (dir_in_load_path)
538 addpath_option =
false;
572 std::list<std::string>
575 std::list<std::string> retval;
582 nm_ldr.second.overloads (meth, retval);
587 std::list<std::string>
590 std::list<std::string> retval;
594 if (! only_top_level || dir_ldr.first.find (
'.') == std::string::npos)
595 retval.push_back (dir_ldr.first);
607 || sys::env::rooted_relative_pathname (file))
609 sys::file_stat fs (file);
611 return fs.exists () ? file : retval;
617 if (! tfile.empty ())
622 != std::string::npos)
630 sys::file_stat fs (tfile);
647 if (all_files[i] == file)
663 || sys::env::rooted_relative_pathname (dir)))
665 sys::file_stat fs (dir);
667 if (fs.exists () && fs.is_dir ())
675 std::string dname = di.abs_dir_name;
677 std::size_t dname_len = dname.length ();
679 if (dname.substr (dname_len - 1)
682 dname = dname.substr (0, dname_len - 1);
686 std::size_t dir_len = canon_dir.length ();
688 if (dname_len > dir_len
690 && canon_dir == dname.substr (dname_len - dir_len))
692 sys::file_stat fs (di.dir_name);
694 if (fs.exists () && fs.is_dir ())
695 return di.abs_dir_name;
706 std::list<std::string> retlist;
710 || sys::env::rooted_relative_pathname (dir)))
712 sys::file_stat fs (dir);
714 if (fs.exists () && fs.is_dir ())
715 retlist.push_back (dir);
722 std::string dname = di.abs_dir_name;
724 std::size_t dname_len = dname.length ();
726 if (dname.substr (dname_len - 1)
729 dname = dname.substr (0, dname_len - 1);
733 std::size_t dir_len = canon_dir.length ();
735 if (dname_len > dir_len
737 && canon_dir == dname.substr (dname_len - dir_len))
739 sys::file_stat fs (di.dir_name);
741 if (fs.exists () && fs.is_dir ())
742 retlist.push_back (di.abs_dir_name);
755 std::string dir_name;
756 std::string file_name;
765 std::string file = flist[i];
768 != std::string::npos)
771 || sys::env::rooted_relative_pathname (file))
773 sys::file_stat fs (file);
785 sys::file_stat fs (tfile);
793 rel_flist[rel_flen++] = file;
796 rel_flist.
resize (rel_flen);
808 if (all_files[i] == rel_flist[j])
810 dir_name = di.abs_dir_name;
811 file_name = rel_flist[j];
821 if (! dir_name.empty ())
830 std::list<std::string> retlist;
832 std::string dir_name;
833 std::string file_name;
842 std::string file = flist[i];
845 != std::string::npos)
848 || sys::env::rooted_relative_pathname (file))
850 sys::file_stat fs (file);
853 retlist.push_back (file);
862 sys::file_stat fs (tfile);
865 retlist.push_back (tfile);
870 rel_flist[rel_flen++] = file;
873 rel_flist.
resize (rel_flen);
885 if (all_files[i] == rel_flist[j])
905 retval[k++] = di.dir_name;
910 std::list<std::string>
913 std::list<std::string> retval;
916 retval.push_back (di.dir_name);
929 retval = p->fcn_files;
937 std::string fname = retval[i];
939 std::size_t pos = fname.rfind (
'.');
941 if (pos != std::string::npos)
942 retval[i] = fname.substr (0, pos);
968 xpath += directory_path::path_sep_str () + xdirs[i];
980 if (! fcn_files.
empty ())
982 os <<
"\n*** function files in " << di.dir_name <<
":\n\n";
988 = di.method_file_map;
990 if (! method_file_map.empty ())
992 for (
const auto& cls_ci : method_file_map)
994 os <<
"\n*** methods in " << di.dir_name
995 <<
"/@" << cls_ci.first <<
":\n\n";
1009 nm_ldr.second.display (os);
1025 const std::string& script_file)
1032 sys::file_stat fs (file);
1051 if (retval->dir_name == dir)
1071 if (retval->dir_name == dir)
1109 l.
move (di, at_end);
1113 for (
const auto& pkg_di : package_dir_map)
1115 std::string full_name = pkg_di.first;
1117 if (! pname.empty ())
1118 full_name = pname +
'.' + full_name;
1120 move (pkg_di.second, at_end, full_name);
1127 std::size_t
len = dir_arg.length ();
1129 if (
len > 1 && dir_arg.substr (
len-2) ==
"//")
1131 "trailing '//' is no longer special in search path elements");
1145 sys::file_stat fs (dir);
1166 warning (
"addpath: %s: not a directory", dir_arg.c_str ());
1170 std::string msg = fs.error ();
1171 warning (
"addpath: %s: %s", dir_arg.c_str (), msg.c_str ());
1192 for (
const auto& pkg_di : package_dir_map)
1194 std::string full_name = pkg_di.first;
1196 if (! pname.empty ())
1197 full_name = pname +
'.' + full_name;
1199 remove (pkg_di.second, full_name);
1218 std::string enc_val =
"delete";
1223 unwind_action close_file ([cfile] (
void) { fclose (cfile); });
1227 const std::string enc_prop =
"encoding";
1230 std::string conf_str =
fgets (cfile, eof);
1233 auto it = std::find_if_not (conf_str.begin (), conf_str.end (),
1234 [] (
unsigned char c)
1235 { return std::isblank (c); });
1236 conf_str.erase (conf_str.begin (), it);
1239 if (conf_str.compare (0, enc_prop.size (), enc_prop) == 0)
1242 std::size_t pos = conf_str.find_first_not_of (
" \t=:",
1244 if (pos == std::string::npos)
1247 std::string enc_val = conf_str.substr (pos);
1250 it = std::find_if_not (enc_val.begin (), enc_val.end (),
1251 [] (
unsigned char c)
1252 { return std::isalnum (c) || c ==
'-'; });
1253 enc_val.erase(it, enc_val.end ());
1255 if (enc_val.empty ())
1270 std::string enc_val =
"delete";
1280 if (di.is_package (
name))
1289 const std::string& pname,
bool updating)
1293 l.
add (di, at_end, updating);
1297 for (
const auto& pkg_di : package_dir_map)
1299 std::string full_name = pkg_di.first;
1301 if (! pname.empty ())
1302 full_name = pname +
'.' + full_name;
1304 add (pkg_di.second, at_end, full_name);
1317 for (
const auto& nm_typ : lst)
1319 std::string nm = nm_typ.first;
1321 int types = nm_typ.second;
1330 retval[count++] = nm;
1345 warning (
"load_path: %s: %s",
d.c_str (), msg.c_str ());
1352 std::string fname = flist[i];
1354 std::size_t pos = fname.rfind (
'.');
1356 if (pos != std::string::npos)
1358 std::string base = fname.substr (0, pos);
1359 std::string ext = fname.substr (pos);
1367 else if (ext ==
".oct")
1369 else if (ext ==
".mex")
1375 = retval.find (base);
1377 if (p == retval.end ())
1397 std::string msg = fs.error ();
1399 "load_path: %s: %s",
dir_name.c_str (), msg.c_str ());
1421 if ((fs.mtime () + fs.time_resolution ()
1467 std::size_t pos =
name.find (
'.');
1469 if (pos == std::string::npos)
1470 return package_dir_map.find (
name) != package_dir_map.end ();
1473 std::string name_head =
name.substr (0, pos);
1474 std::string name_tail =
name.substr (pos + 1);
1478 if (it != package_dir_map.end ())
1479 return it->second.is_package (name_tail);
1490 dir_time_last_checked = sys::time (
static_cast<OCTAVE_TIME_T
> (0));
1492 sys::file_stat fs (dir_name);
1496 method_file_map.clear ();
1497 package_dir_map.clear ();
1499 dir_mtime = fs.mtime ();
1500 dir_time_last_checked = sys::time ();
1527 std::string msg = fs.error ();
1528 warning (
"load_path: %s: %s", dir_name.c_str (), msg.c_str ());
1540 warning (
"load_path: %s: %s",
d.c_str (), msg.c_str ());
1546 all_files.resize (
len);
1547 fcn_files.resize (
len);
1554 std::string fname = flist[i];
1558 sys::file_stat fs (full_name);
1564 if (fname ==
"private")
1565 get_private_file_map (full_name);
1566 else if (fname[0] ==
'@')
1567 get_method_file_map (full_name, fname.substr (1));
1568 else if (fname[0] ==
'+')
1569 get_package_dir (full_name, fname.substr (1));
1573 all_files[all_files_count++] = fname;
1575 std::size_t pos = fname.rfind (
'.');
1577 if (pos != std::string::npos)
1579 std::string ext = fname.substr (pos);
1581 if (ext ==
".m" || ext ==
".oct" || ext ==
".mex")
1583 std::string base = fname.substr (0, pos);
1586 fcn_files[fcn_files_count++] = fname;
1593 all_files.resize (all_files_count);
1594 fcn_files.resize (fcn_files_count);
1605 const std::string& class_name)
1611 sys::file_stat fs (pd);
1613 if (fs && fs.is_dir ())
1614 method_file_map[class_name].private_file_map =
get_fcn_files (pd);
1619 const std::string& package_name)
1621 package_dir_map[package_name] =
dir_info (
d);
1629 auto s =
std::find (m_dir_list.begin (), m_dir_list.end (), dir_name);
1631 if (s != m_dir_list.end ())
1633 m_dir_list.erase (s);
1636 m_dir_list.push_back (dir_name);
1638 m_dir_list.push_front (dir_name);
1641 move_fcn_map (dir_name, di.
fcn_files, at_end);
1645 move_method_map (dir_name, at_end);
1655 m_dir_list.remove (dir);
1657 remove_fcn_map (dir, fcn_files);
1659 remove_private_fcn_map (dir);
1661 remove_method_map (dir);
1667 os <<
"*** package_info: "
1668 << (m_package_name.empty () ?
"<top-level>" : m_package_name)
1671 for (
const auto& dir : m_dir_list)
1675 for (
const auto& dir_fnlst : m_private_fcn_map)
1677 os <<
"\n*** private functions in "
1681 print_fcn_list (os, dir_fnlst.second);
1684#if defined (DEBUG_LOAD_PATH)
1686 for (
const auto& nm_filst : m_fcn_map)
1688 os << nm_filst.first <<
":\n";
1692 for (
const auto& finfo : file_info_list)
1694 os <<
" " << finfo.dir_name <<
" (";
1696 print_types (os, finfo.types);
1702 for (
const auto& cls_fnmap : m_method_map)
1704 os <<
"CLASS " << cls_fnmap.first <<
":\n";
1708 for (
const auto& nm_fnlst : m_fcn_map)
1710 os <<
" " << nm_fnlst.first <<
":\n";
1714 for (
const auto& finfo : file_info_list)
1716 os <<
" " << finfo.dir_name <<
" (";
1718 print_types (os, finfo.types);
1732 std::string& dir_name,
1739 if (fcn.length () > 0 && fcn[0] ==
'@')
1741 std::size_t pos = fcn.find (
'/');
1743 if (pos != std::string::npos)
1745 std::string class_name = fcn.substr (1, pos-1);
1746 std::string meth = fcn.substr (pos+1);
1748 retval =
find_method (class_name, meth, dir_name);
1759 if (p != m_fcn_map.end ())
1763 for (
const auto&
fi : file_info_list)
1767 if (check_file_type (retval, type,
fi.types,
1768 fcn,
"load_path::find_fcn"))
1770 dir_name =
fi.dir_name;
1784 const std::string& fcn,
1793 if (q != m_private_fcn_map.end ())
1799 if (p != fcn_file_map.end ())
1804 if (check_file_type (fname, type, p->second, fcn,
1805 "load_path::find_private_fcn"))
1815 const std::string& meth,
1816 std::string& dir_name,
1827 if (q != m_method_map.end ())
1837 for (
const auto&
fi : file_info_list)
1841 bool found = check_file_type (retval, type,
fi.types,
1842 meth,
"load_path::find_method");
1846 dir_name =
fi.dir_name;
1858 std::list<std::string>
1861 std::list<std::string> retval;
1867 if (mtd_map_it != m_method_map.end ())
1869 for (
const auto& nm_filst : mtd_map_it->second)
1870 retval.push_back (nm_filst.first);
1873 if (! retval.empty ())
1881 std::list<std::string>& l)
const
1883 for (
const auto& cls_fnmap : m_method_map)
1887 if (m.find (meth) != m.end ())
1889 std::string class_name = cls_fnmap.first;
1891 if (! m_package_name.empty ())
1892 class_name = m_package_name +
'.' + class_name;
1894 l.push_back (class_name);
1902 std::size_t
len = m_fcn_map.size ();
1908 for (
const auto& nm_filst : m_fcn_map)
1909 retval[count++] = nm_filst.first;
1916 bool at_end,
bool updating)
1926 std::string fname = fcn_files[i];
1929 std::string base = fname;
1931 std::size_t pos = fname.rfind (
'.');
1933 if (pos != std::string::npos)
1935 base = fname.substr (0, pos);
1936 ext = fname.substr (pos);
1941 auto p = file_info_list.begin ();
1943 while (p != file_info_list.end ())
1945 if (p->dir_name == dir_name)
1954 else if (ext ==
".oct")
1956 else if (ext ==
".mex")
1959 if (p == file_info_list.end ())
1966 if (file_info_list.empty ())
1976 "function %s shadows a built-in function",
1982 file_info& old = file_info_list.front ();
1991 if (fname !=
"Contents.m"
1998 "function %s shadows a core library function",
2007 file_info_list.push_back (
fi);
2009 file_info_list.push_front (
fi);
2025 if (! private_file_map.empty ())
2037 for (
const auto& cls_ci : method_file_map)
2039 std::string class_name = cls_ci.first;
2043 std::string full_dir_name
2051 for (
const auto& nm_typ : m)
2053 std::string base = nm_typ.first;
2054 int types = nm_typ.second;
2058 auto p2 = file_info_list.begin ();
2059 while (p2 != file_info_list.end ())
2061 if (p2->dir_name == full_dir_name)
2067 if (p2 == file_info_list.end ())
2072 file_info_list.push_back (
fi);
2074 file_info_list.push_front (
fi);
2088 if (! private_file_map.empty ())
2089 m_private_fcn_map[full_dir_name] = private_file_map;
2101 std::string fname = fcn_files[k];
2104 std::string base = fname;
2106 std::size_t pos = fname.rfind (
'.');
2108 if (pos != std::string::npos)
2110 base = fname.substr (0, pos);
2111 ext = fname.substr (pos);
2116 if (file_info_list.size () == 1)
2120 for (
auto fi_it = file_info_list.begin ();
2121 fi_it != file_info_list.end ();
2124 if (fi_it->dir_name == dir_name)
2128 file_info_list.erase (fi_it);
2131 file_info_list.push_back (fi_tmp);
2133 file_info_list.push_front (fi_tmp);
2146 for (
auto& cls_fnmap : m_method_map)
2148 std::string class_name = cls_fnmap.first;
2152 std::string full_dir_name
2155 for (
auto& nm_filst : fn_map)
2159 if (file_info_list.size () == 1)
2163 for (
auto fi_it = file_info_list.begin ();
2164 fi_it != file_info_list.end (); fi_it++)
2166 if (fi_it->dir_name == full_dir_name)
2170 file_info_list.erase (fi_it);
2173 file_info_list.push_back (fi_tmp);
2175 file_info_list.push_front (fi_tmp);
2193 std::string fname = fcn_files[k];
2196 std::string base = fname;
2198 std::size_t pos = fname.rfind (
'.');
2200 if (pos != std::string::npos)
2202 base = fname.substr (0, pos);
2203 ext = fname.substr (pos);
2208 for (
auto fi_it = file_info_list.begin ();
2209 fi_it != file_info_list.end ();
2212 if (fi_it->dir_name == dir)
2214 file_info_list.erase (fi_it);
2216 if (file_info_list.empty ())
2217 m_fcn_map.erase (fname);
2228 auto p = m_private_fcn_map.find (dir);
2230 if (p != m_private_fcn_map.end ())
2231 m_private_fcn_map.erase (p);
2237 for (
auto& cls_fnmap : m_method_map)
2239 std::string class_name = cls_fnmap.first;
2243 std::string full_dir_name
2246 for (
auto& nm_filst : fn_map)
2250 if (file_info_list.size () == 1)
2254 for (
auto fi_it = file_info_list.begin ();
2255 fi_it != file_info_list.end (); fi_it++)
2257 if (fi_it->dir_name == full_dir_name)
2259 file_info_list.erase (fi_it);
2275 const std::string& fcn,
2276 const char *who)
const
2278 bool retval =
false;
2363 error (
"%s: %s: invalid type code = %d", who, fcn.c_str (), type);
2371 bool printed_type =
false;
2376 printed_type =
true;
2384 printed_type =
true;
2392 printed_type =
true;
2400 for (
const auto& nm_typ : lst)
2402 os <<
" " << nm_typ.first <<
" (";
2404 print_types (os, nm_typ.second);
2422 dirlist = dirlist.
sort (
false);
2428 std::string elt = dirlist[i];
2430 bool skip_p = (elt ==
"." || elt ==
".." || elt[0] ==
'@'
2437 skip_p = (elt == skip[j]);
2446 sys::file_stat fs (nm);
2448 if (fs && fs.is_dir ())
2449 retval += directory_path::path_sep_str () +
genpath (nm, skip);
2472 int nargin = args.length ();
2481 std::string
dirname = args(0).xstring_value (
"genpath: DIR must be a string");
2487 std::string
dirname = args(0).xstring_value (
"genpath: all arguments must be strings");
2492 skip[i-1] = args(i).xstring_value (
"genpath: all arguments must be strings");
2511DEFMETHOD (command_line_path, interp, args, ,
2519 if (! args.empty ())
2522 load_path& lp = interp.get_load_path ();
2527DEFMETHOD (restoredefaultpath, interp, args, ,
2535 if (! args.empty ())
2538 load_path& lp = interp.get_load_path ();
2556 load_path& lp = interp.get_load_path ();
2582 int nargin = args.length ();
2586 load_path& lp = interp.get_load_path ();
2590 std::string
path = argv[1];
2592 for (
int i = 2; i <= nargin; i++)
2593 path += directory_path::path_sep_str () + argv[i];
2602 else if (nargin == 0 && nargout == 0)
2605 "\nOctave's search path contains the following directories:\n\n";
2617DEFMETHOD (addpath, interp, args, nargout,
2651 int nargin = args.length ();
2656 load_path& lp = interp.get_load_path ();
2661 retval = lp.
path ();
2671 if (option ==
"-end")
2676 else if (option ==
"-begin")
2681 int val = option_arg.
xint_value (
"addpath: OPTION must be '-begin'/0 or '-end'/1");
2691 error (
"addpath: OPTION must be '-begin'/0 or '-end'/1");
2694 bool need_to_update =
false;
2700 for (
int i = 0; i < arglist.
length (); i++)
2702 std::string arg = arglist(i).xstring_value (
"addpath: all arguments must be strings");
2704 std::list<std::string> dir_elts =
split_path (arg);
2707 std::reverse (dir_elts.begin (), dir_elts.end ());
2709 for (
auto dir : dir_elts)
2712 auto it_start = dir.begin ();
2713#if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM)
2717 dir.erase (std::unique
2718 (it_start, dir.end (),
2721 return l == r && sys::file_ops::is_dir_sep (l);
2726 if (pos == std::string::npos)
2728 if (! dir.empty () && dir[0] ==
'+')
2730 "addpath: package directories should not be "
2731 "added to path: %s\n", dir.c_str ());
2735 if (pos + 1 < dir.length () && dir[pos+1] ==
'+')
2737 "addpath: package directories should not be "
2738 "added to path: %s\n", dir.c_str ());
2746 need_to_update =
true;
2756DEFMETHOD (rmpath, interp, args, nargout,
2778 int nargin = args.length ();
2785 load_path& lp = interp.get_load_path ();
2788 retval = lp.
path ();
2790 bool need_to_update =
false;
2792 for (
int i = 0; i < nargin; i++)
2794 std::string arg = args(i).xstring_value (
"rmpath: all arguments must be strings");
2795 std::list<std::string> dir_elts =
split_path (arg);
2797 for (
const auto& dir : dir_elts)
2803 warning (
"rmpath: %s: not found", dir.c_str ());
2805 need_to_update =
true;
2815DEFMETHOD (__dump_load_path__, interp, , ,
2821 load_path& lp = interp.get_load_path ();
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Provides threadsafe access to octave.
void update_path_dialog(void)
int debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
int chdir(const std::string &dir)
event_manager & get_event_manager(void)
void recover_from_exception(void)
package_dir_map_type package_dir_map
sys::time dir_time_last_checked
void get_file_list(const std::string &d)
std::map< std::string, dir_info > package_dir_map_type
fcn_file_map_type::iterator fcn_file_map_iterator
void get_private_file_map(const std::string &d)
std::map< std::string, int > fcn_file_map_type
fcn_file_map_type::const_iterator const_fcn_file_map_iterator
std::map< std::string, class_info > method_file_map_type
void get_package_dir(const std::string &d, const std::string &package_name)
fcn_file_map_type private_file_map
void get_method_file_map(const std::string &d, const std::string &class_name)
package_dir_map_type::const_iterator const_package_dir_map_iterator
method_file_map_type method_file_map
bool is_package(const std::string &name) const
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, int type=M_FILE|OCT_FILE|MEX_FILE) const
void add_to_private_fcn_map(const dir_info &di)
void remove_method_map(const std::string &dir)
std::string find_fcn(const std::string &fcn, std::string &dir_name, int type=M_FILE|OCT_FILE|MEX_FILE) const
void add_to_method_map(const dir_info &di, bool at_end)
std::list< std::string > methods(const std::string &class_name) const
void remove_fcn_map(const std::string &dir, const string_vector &fcn_files)
void move(const dir_info &di, bool at_end)
void add(const dir_info &di, bool at_end, bool updating)
void overloads(const std::string &meth, std::list< std::string > &l) const
bool check_file_type(std::string &fname, int type, int possible_types, const std::string &fcn, const char *who) const
void add_to_fcn_map(const dir_info &di, bool at_end, bool updating)
void remove(const dir_info &di)
void move_method_map(const std::string &dir, bool at_end)
void display(std::ostream &out) const
std::string find_private_fcn(const std::string &dir, const std::string &fcn, int type=M_FILE|OCT_FILE|MEX_FILE) const
void remove_private_fcn_map(const std::string &dir)
void print_fcn_list(std::ostream &os, const dir_info::fcn_file_map_type &lst) const
void move_fcn_map(const std::string &dir, const string_vector &fcn_files, bool at_end)
void print_types(std::ostream &os, int types) const
string_vector fcn_names(void) const
std::string find_first_of(const string_vector &files) const
string_vector files(const std::string &dir, bool omit_exts=false) const
string_vector find_matching_dirs(const std::string &dir) const
void set(const std::string &p, bool warn=false, bool is_init=false)
static std::string s_sys_path
std::list< file_info > file_info_list_type
const_dir_info_list_iterator find_dir_info(const std::string &dir) const
method_map_type::const_iterator const_method_map_iterator
dir_info_list_type::const_iterator const_dir_info_list_iterator
load_path(interpreter &interp)
bool contains_canonical(const std::string &dir_name) const
bool contains(const std::string &dir) const
string_vector find_all_first_of(const string_vector &files) const
void prepend(const std::string &dir, bool warn=false)
void initialize(bool set_initial_path=false)
string_vector dirs(void) const
dir_info_list_type m_dir_info_list
std::map< std::string, dir_info > abs_dir_cache_type
std::set< std::string > m_init_dirs
static abs_dir_cache_type s_abs_dir_cache
dir_info_list_type::iterator dir_info_list_iterator
void move(dir_info_list_iterator i, bool at_end)
std::string find_file(const std::string &file) const
friend dir_info::fcn_file_map_type get_fcn_files(const std::string &d)
string_vector fcn_names(void) const
std::function< void(const std::string &)> add_hook
interpreter & m_interpreter
package_map_type m_package_map
package_info & get_package(const std::string &name)
std::string system_path(void) const
package_info m_top_level_package
void display(std::ostream &os) const
std::string path(void) const
void read_dir_config(const std::string &dir) const
void execute_pkg_add(const std::string &dir)
bool remove(const std::string &dir)
std::string find_dir(const std::string &dir) const
std::list< std::string > overloads(const std::string &meth) const
std::list< std::string > dir_list(void) const
std::string get_command_line_path(void) const
fcn_map_type::const_iterator const_fcn_map_iterator
abs_dir_cache_type::const_iterator const_abs_dir_cache_iterator
bool contains_file_in_dir(const std::string &file_name, const std::string &dir_name)
void add(const std::string &dir, bool at_end, bool warn)
bool is_package(const std::string &name) const
string_vector get_file_list(const dir_info::fcn_file_map_type &lst) const
void append(const std::string &dir, bool warn=false)
static const int OCT_FILE
std::string m_command_line_path
void execute_pkg_del(const std::string &dir)
private_fcn_map_type::const_iterator const_private_fcn_map_iterator
std::list< std::string > get_all_package_names(bool only_top_level=true) const
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
std::function< void(const std::string &)> remove_hook
static const int MEX_FILE
std::map< std::string, file_info_list_type > fcn_map_type
void execute_pkg_add_or_del(const std::string &dir, const std::string &script_file)
OCTAVE_API void stamp(void)
std::string dir_name(void) const
octave_idx_type length(void) const
octave_value_list & reverse(void)
OCTINTERP_API int xint_value(const char *fmt,...) const
bool isnumeric(void) const
bool is_string(void) const
std::string string_value(bool force=false) const
string_vector & sort(bool make_uniq=false)
void resize(octave_idx_type n, const std::string &rfv="")
std::ostream & list_in_columns(std::ostream &, int width=0, const std::string &prefix="") const
octave_idx_type numel(void) const
bool is_built_in_function_name(const std::string &name)
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
OCTINTERP_API void print_usage(void)
#define DEFMETHOD(name, interp_name, args_name, nargout_name, doc)
Macro to define a builtin method.
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning(const char *fmt,...)
void warning_with_id(const char *id, const char *fmt,...)
void error(const char *fmt,...)
bool octave_interpreter_ready
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
static std::string strip_trailing_separators(const std::string &dir_arg)
static std::string find_private_file(const std::string &fname)
static bool subdirs_modified(const std::string &d, const sys::time &last_checked)
static void maybe_add_path_elts(std::string &path, const std::string &dir)
static bool in_path_list(const std::string &path_list, const std::string &path)
std::string genpath(const std::string &dirname, const string_vector &skip)
static std::list< std::string > split_path(const std::string &p)
load_path::dir_info::fcn_file_map_type get_fcn_files(const std::string &d)
static OCTAVE_NAMESPACE_BEGIN std::string maybe_canonicalize(const std::string &dir_arg)
static void rehash_internal(void)
std::string oct_data_dir(void)
std::string local_oct_file_dir(void)
std::string local_api_fcn_file_dir(void)
std::string local_api_oct_file_dir(void)
std::string fcn_file_dir(void)
std::string local_ver_fcn_file_dir(void)
std::string local_fcn_file_dir(void)
std::string oct_file_dir(void)
std::string local_ver_oct_file_dir(void)
std::string dirname(const std::string &path)
std::string tilde_expand(const std::string &name)
std::string dir_sep_str(void)
std::string canonicalize_file_name(const std::string &name)
bool get_dirlist(const std::string &dirname, string_vector &dirlist, std::string &msg)
std::FILE * fopen(const std::string &filename, const std::string &mode)
std::string fgets(FILE *f)
event_manager & __get_event_manager__(const std::string &who)
input_system & __get_input_system__(const std::string &who)
interpreter & __get_interpreter__(const std::string &who)
symbol_scope __get_current_scope__(const std::string &who)
load_path & __get_load_path__(const std::string &who)
symbol_table & __get_symbol_table__(const std::string &who)
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.
static bool absolute_pathname(const std::string &s)
static bool is_dir_sep(char c)
static std::string dir_sep_chars
fcn_file_map_type method_file_map
fcn_file_map_type private_file_map
OCTAVE_NAMESPACE_BEGIN bool valid_identifier(const char *s)
bool same_file(const std::string &f, const std::string &g)