#include "oct-env.h"
Public Member Functions | |
env (const env &)=delete | |
env & | operator= (const env &)=delete |
Static Public Member Functions | |
static bool | absolute_pathname (const std::string &s) |
static std::string | base_pathname (const std::string &s) |
static bool | chdir (const std::string &newdir) |
static std::string | get_current_directory (void) |
static std::string | get_home_directory (void) |
static std::string | get_host_name (void) |
static std::string | get_program_invocation_name (void) |
static std::string | get_program_name (void) |
static std::string | get_temp_directory (void) |
static std::string | get_user_config_directory (void) |
static std::string | get_user_name (void) |
static std::string | getenv (const std::string &name) |
static bool | have_x11_display (void) |
static std::string | make_absolute (const std::string &s, const std::string &dot_path=get_current_directory()) |
static std::string | polite_directory_format (const std::string &name) |
static void | putenv (const std::string &name, const std::string &value) |
static bool | rooted_relative_pathname (const std::string &s) |
static void | set_program_name (const std::string &s) |
Protected Member Functions | |
env (void) | |
Private Member Functions | |
bool | do_absolute_pathname (const std::string &s) const |
std::string | do_base_pathname (const std::string &s) const |
bool | do_chdir (const std::string &newdir) |
std::string | do_get_home_directory (void) const |
std::string | do_get_host_name (void) const |
std::string | do_get_temp_directory (void) const |
std::string | do_get_user_config_directory (void) const |
std::string | do_get_user_name (void) const |
std::string | do_getcwd (void) const |
std::string | do_getenv (const std::string &name) const |
std::string | do_make_absolute (const std::string &s, const std::string &dot_path) const |
std::string | do_polite_directory_format (const std::string &name) const |
void | do_putenv (const std::string &name, const std::string &value) const |
bool | do_rooted_relative_pathname (const std::string &s) const |
void | do_set_program_name (const std::string &s) const |
void | error (const std::string &) const |
void | error (int) const |
void | pathname_backup (std::string &path, int n) const |
Static Private Member Functions | |
static void | cleanup_instance (void) |
static bool | instance_ok (void) |
Private Attributes | |
std::string | current_directory |
bool | follow_symbolic_links |
std::string | host_name |
std::string | prog_invocation_name |
std::string | prog_name |
std::string | user_name |
bool | verbatim_pwd |
Static Private Attributes | |
static env * | instance = nullptr |
|
protected |
Definition at line 74 of file oct-env.cc.
References do_get_host_name(), do_get_user_name(), and do_getcwd().
Referenced by instance_ok().
|
delete |
|
static |
Definition at line 112 of file oct-env.cc.
References do_absolute_pathname(), instance, and instance_ok().
Referenced by octave::tree_evaluator::check_autoload_file(), octave::fcn_file_in_path(), octave::load_path::find_all_first_of(), octave::find_data_file_in_load_path(), octave::load_path::find_dir(), octave::load_path::find_file(), octave::load_path::find_first_of(), octave::load_path::find_matching_dirs(), Fis_absolute_filename(), octave::load_path::dir_info::initialize(), kpse_absolute_p(), octave::load_fcn_from_file(), octave::maybe_canonicalize(), octave::out_of_date_check(), and octave::config::prepend_home_dir().
|
static |
Definition at line 126 of file oct-env.cc.
References do_base_pathname(), instance, and instance_ok().
Referenced by octave::load_path::contains_file_in_dir(), F__parse_file__(), octave::get_help_from_file(), and octave::load_fcn_from_file().
|
static |
Definition at line 292 of file oct-env.cc.
References do_chdir(), instance, and instance_ok().
Referenced by octave::interpreter::chdir().
|
inlinestaticprivate |
Definition at line 135 of file oct-env.h.
Referenced by instance_ok().
|
private |
Definition at line 354 of file oct-env.cc.
References octave::sys::file_ops::is_dir_sep(), and len.
Referenced by absolute_pathname(), do_base_pathname(), and do_make_absolute().
|
private |
Definition at line 403 of file oct-env.cc.
References octave::sys::file_ops::dir_sep_chars(), do_absolute_pathname(), and do_rooted_relative_pathname().
Referenced by base_pathname().
|
private |
Definition at line 575 of file oct-env.cc.
References octave::sys::chdir(), current_directory, do_getcwd(), do_make_absolute(), follow_symbolic_links, octave::sys::file_ops::is_dir_sep(), and retval.
Referenced by chdir().
|
private |
Definition at line 511 of file oct-env.cc.
References octave::sys::password::dir(), octave::sys::file_ops::dir_sep_str(), do_getenv(), octave::sys::password::getpwuid(), and octave::sys::getuid().
Referenced by do_get_user_config_directory(), do_polite_directory_format(), and get_home_directory().
|
private |
Definition at line 551 of file oct-env.cc.
References host_name, and octave_gethostname_wrapper().
Referenced by env(), and get_host_name().
|
private |
Definition at line 203 of file oct-env.cc.
References do_getenv().
Referenced by get_temp_directory().
|
private |
Definition at line 242 of file oct-env.cc.
References octave::sys::file_ops::dir_sep_str(), do_get_home_directory(), do_getenv(), free(), path, and u8_from_wchar().
Referenced by get_user_config_directory().
|
private |
Definition at line 538 of file oct-env.cc.
References octave::sys::password::getpwuid(), octave::sys::getuid(), octave::sys::password::name(), and user_name.
Referenced by env(), and get_user_name().
|
private |
Definition at line 496 of file oct-env.cc.
References current_directory, follow_symbolic_links, octave::sys::getcwd(), and verbatim_pwd.
Referenced by env(), do_chdir(), and get_current_directory().
|
private |
Definition at line 566 of file oct-env.cc.
References octave::sys::getenv_wrapper(), and name.
Referenced by do_get_home_directory(), do_get_temp_directory(), do_get_user_config_directory(), and getenv().
|
private |
Definition at line 420 of file oct-env.cc.
References octave::sys::file_ops::dir_sep_chars(), octave::sys::file_ops::dir_sep_str(), do_absolute_pathname(), octave::sys::file_ops::is_dir_sep(), and pathname_backup().
Referenced by do_chdir(), and make_absolute().
|
private |
Definition at line 333 of file oct-env.cc.
References do_get_home_directory(), octave::sys::file_ops::is_dir_sep(), len, name, and retval.
Referenced by polite_directory_format().
|
private |
|
private |
Definition at line 375 of file oct-env.cc.
References octave::sys::file_ops::is_dir_sep(), and len.
Referenced by do_base_pathname(), and rooted_relative_pathname().
|
private |
Definition at line 299 of file oct-env.cc.
References octave::sys::file_ops::dir_sep_chars(), octave_set_program_name_wrapper(), prog_invocation_name, prog_name, and strsave().
Referenced by set_program_name().
|
private |
Definition at line 648 of file oct-env.cc.
|
private |
Definition at line 642 of file oct-env.cc.
|
static |
Definition at line 140 of file oct-env.cc.
References do_getcwd(), instance, and instance_ok().
Referenced by octave::interpreter::chdir(), octave::load_path::contains_file_in_dir(), Fcd(), Fpwd(), and initial_class_path().
|
static |
Definition at line 147 of file oct-env.cc.
References do_get_home_directory(), instance, and instance_ok().
Referenced by octave::history_system::default_file(), octave::interpreter::execute_startup_files(), Fcd(), Fget_home_directory(), initial_class_path(), kpse_tilde_expand(), octave::files_dock_widget::popdownmenu_home(), and octave::tilde_expand_word().
|
static |
Definition at line 196 of file oct-env.cc.
References do_get_host_name(), instance, and instance_ok().
Referenced by octave::history_system::default_timestamp_format(), Fgethostname(), and octave::load_save_system::init_save_header_format().
|
static |
Definition at line 175 of file oct-env.cc.
References instance, instance_ok(), and prog_invocation_name.
Referenced by maybe_initialize_magick().
|
static |
Definition at line 168 of file oct-env.cc.
References instance, instance_ok(), and prog_name.
|
static |
Definition at line 154 of file oct-env.cc.
References do_get_temp_directory(), instance, and instance_ok().
Referenced by octave::sys::tempnam().
|
static |
Definition at line 161 of file oct-env.cc.
References do_get_user_config_directory(), instance, and instance_ok().
Referenced by octave::interpreter::execute_startup_files().
|
static |
Definition at line 189 of file oct-env.cc.
References do_get_user_name(), instance, and instance_ok().
Referenced by octave::history_system::default_timestamp_format(), and octave::load_save_system::init_save_header_format().
|
static |
Definition at line 271 of file oct-env.cc.
References do_getenv(), instance, instance_ok(), and name.
Referenced by octave::base_qobject::base_qobject(), octave::curl_transfer::curl_transfer(), octave::append_to_shell_path(), octave::history_system::default_file(), octave::default_pager(), octave::default_qt_settings_file(), octave::history_system::default_size(), octave::ft_manager::do_get_font(), octave::interpreter::execute_startup_files(), Fgetenv(), Ftempname(), octave::resource_manager::get_default_font_family(), octave::resource_manager::get_gui_translation_dir(), octave::config::get_local_site_defaults_file(), octave::config::get_octave_exec_home(), octave::config::get_octave_home(), octave::get_P_tmpdir(), octave::config::get_site_defaults_file(), have_gnuplot_binary(), have_x11_display(), octave::directory_path::init(), octave::environment::init_editor(), octave::environment::init_exec_path(), octave::environment::init_image_path(), initial_java_dir(), octave::history_system::initialize(), octave::load_path::initialize(), initialize_jvm(), and octave::resource_manager::reload_settings().
|
static |
Definition at line 284 of file oct-env.cc.
References getenv().
|
staticprivate |
Definition at line 91 of file oct-env.cc.
References env(), singleton_cleanup_list::add(), cleanup_instance(), instance, and retval.
Referenced by absolute_pathname(), base_pathname(), chdir(), get_current_directory(), get_home_directory(), get_host_name(), get_program_invocation_name(), get_program_name(), get_temp_directory(), get_user_config_directory(), get_user_name(), getenv(), make_absolute(), polite_directory_format(), rooted_relative_pathname(), and set_program_name().
|
static |
Definition at line 133 of file oct-env.cc.
References do_make_absolute(), instance, and instance_ok().
Referenced by octave::tree_evaluator::check_autoload_file(), octave::contents_file_in_path(), octave::tree_evaluator::echo(), octave::interpreter::execute_startup_files(), F__parse_file__(), Ffile_in_loadpath(), octave::file_in_path(), octave::find_data_file_in_load_path(), Fmake_absolute_filename(), Furlwrite(), octave::file_editor::handle_file_remove(), octave::load_fcn_from_file(), octave::make_absolute(), read_mat5_binary_element(), octave::search_path_for_all_files(), octave::search_path_for_file(), octave::tree_evaluator::source_file(), and octave::sys::file_stat::update_internal().
|
private |
Definition at line 610 of file oct-env.cc.
References octave::sys::file_ops::is_dir_sep(), min(), n, and path.
Referenced by do_make_absolute().
|
static |
Definition at line 105 of file oct-env.cc.
References do_polite_directory_format(), instance, instance_ok(), and name.
|
static |
Definition at line 278 of file oct-env.cc.
References name, and octave::sys::putenv_wrapper().
Referenced by octave::interpreter::interpreter(), octave::main_window::main_window(), octave::append_to_shell_path(), and Fsetenv().
|
static |
Definition at line 119 of file oct-env.cc.
References do_rooted_relative_pathname(), instance, and instance_ok().
Referenced by octave::load_path::find_all_first_of(), octave::find_data_file_in_load_path(), octave::load_path::find_dir(), octave::load_path::find_file(), octave::load_path::find_first_of(), octave::load_path::find_matching_dirs(), Fis_rooted_relative_filename(), and kpse_absolute_p().
|
static |
Definition at line 182 of file oct-env.cc.
References do_set_program_name(), instance, and instance_ok().
Referenced by main().
|
mutableprivate |
Definition at line 146 of file oct-env.h.
Referenced by do_chdir(), and do_getcwd().
|
private |
Definition at line 139 of file oct-env.h.
Referenced by do_chdir(), and do_getcwd().
|
mutableprivate |
Definition at line 155 of file oct-env.h.
Referenced by do_get_host_name().
|
staticprivate |
Definition at line 133 of file oct-env.h.
Referenced by absolute_pathname(), base_pathname(), chdir(), get_current_directory(), get_home_directory(), get_host_name(), get_program_invocation_name(), get_program_name(), get_temp_directory(), get_user_config_directory(), get_user_name(), getenv(), instance_ok(), make_absolute(), polite_directory_format(), rooted_relative_pathname(), and set_program_name().
|
mutableprivate |
Definition at line 151 of file oct-env.h.
Referenced by do_set_program_name(), and get_program_invocation_name().
|
mutableprivate |
Definition at line 149 of file oct-env.h.
Referenced by do_set_program_name(), and get_program_name().
|
mutableprivate |
Definition at line 153 of file oct-env.h.
Referenced by do_get_user_name().
|
private |
Definition at line 143 of file oct-env.h.
Referenced by do_getcwd().