#include "oct-env.h"
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_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 | |
octave_env (void) | |
Private Member Functions | |
octave_env (const octave_env &) | |
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_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 |
octave_env & | operator= (const octave_env &) |
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 octave_env * | instance = 0 |
Definition at line 28 of file oct-env.h.
octave_env::octave_env | ( | void | ) | [protected] |
Definition at line 63 of file oct-env.cc.
References do_get_host_name(), do_get_user_name(), and do_getcwd().
Referenced by instance_ok().
octave_env::octave_env | ( | const octave_env & | ) | [private] |
bool octave_env::absolute_pathname | ( | const std::string & | s | ) | [static] |
Definition at line 111 of file oct-env.cc.
References do_absolute_pathname(), instance, and instance_ok().
Referenced by DEFUN(), load_path::do_find_all_first_of(), load_path::do_find_dir(), load_path::do_find_file(), load_path::do_find_first_of(), load_path::do_find_matching_dirs(), do_stream_open(), fcn_file_in_path(), find_file_to_load(), load_path::dir_info::initialize(), mex_file_in_path(), oct_file_in_path(), and out_of_date_check().
std::string octave_env::base_pathname | ( | const std::string & | s | ) | [static] |
Definition at line 125 of file oct-env.cc.
References do_base_pathname(), instance, and instance_ok().
bool octave_env::chdir | ( | const std::string & | newdir | ) | [static] |
Definition at line 213 of file oct-env.cc.
References do_chdir(), instance, and instance_ok().
Referenced by octave_change_to_directory().
static void octave_env::cleanup_instance | ( | void | ) | [inline, static, private] |
Definition at line 119 of file oct-env.h.
Referenced by instance_ok().
bool octave_env::do_absolute_pathname | ( | const std::string & | s | ) | const [private] |
Definition at line 261 of file oct-env.cc.
References file_ops::is_dir_sep().
Referenced by absolute_pathname(), do_base_pathname(), and do_make_absolute().
std::string octave_env::do_base_pathname | ( | const std::string & | s | ) | const [private] |
Definition at line 309 of file oct-env.cc.
References file_ops::dir_sep_chars(), do_absolute_pathname(), and do_rooted_relative_pathname().
Referenced by base_pathname().
bool octave_env::do_chdir | ( | const std::string & | newdir | ) | [private] |
Definition at line 475 of file oct-env.cc.
References current_directory, do_getcwd(), do_make_absolute(), follow_symbolic_links, file_ops::is_dir_sep(), and octave_chdir().
Referenced by chdir().
std::string octave_env::do_get_home_directory | ( | void | ) | const [private] |
Definition at line 409 of file oct-env.cc.
References octave_passwd::dir(), file_ops::dir_sep_str(), do_getenv(), octave_passwd::getpwuid(), and octave_syscalls::getuid().
Referenced by do_polite_directory_format(), and get_home_directory().
std::string octave_env::do_get_host_name | ( | void | ) | const [private] |
Definition at line 449 of file oct-env.cc.
References host_name.
Referenced by get_host_name(), and octave_env().
std::string octave_env::do_get_user_name | ( | void | ) | const [private] |
Definition at line 436 of file oct-env.cc.
References octave_passwd::getpwuid(), octave_syscalls::getuid(), octave_passwd::name(), and user_name.
Referenced by get_user_name(), and octave_env().
std::string octave_env::do_getcwd | ( | void | ) | const [private] |
Definition at line 394 of file oct-env.cc.
References current_directory, follow_symbolic_links, octave_getcwd(), and verbatim_pwd.
Referenced by do_chdir(), do_make_absolute(), get_current_directory(), and octave_env().
std::string octave_env::do_getenv | ( | const std::string & | name | ) | const [private] |
Definition at line 464 of file oct-env.cc.
References getenv().
Referenced by do_get_home_directory(), and getenv().
std::string octave_env::do_make_absolute | ( | const std::string & | s, | |
const std::string & | dot_path | |||
) | const [private] |
Definition at line 326 of file oct-env.cc.
References file_ops::dir_sep_chars(), file_ops::dir_sep_str(), do_absolute_pathname(), do_getcwd(), file_ops::is_dir_sep(), and pathname_backup().
Referenced by do_chdir(), and make_absolute().
std::string octave_env::do_polite_directory_format | ( | const std::string & | name | ) | const [private] |
Definition at line 240 of file oct-env.cc.
References do_get_home_directory(), and file_ops::is_dir_sep().
Referenced by polite_directory_format().
void octave_env::do_putenv | ( | const std::string & | name, | |
const std::string & | value | |||
) | const [private] |
bool octave_env::do_rooted_relative_pathname | ( | const std::string & | s | ) | const [private] |
Definition at line 282 of file oct-env.cc.
References file_ops::is_dir_sep().
Referenced by do_base_pathname(), and rooted_relative_pathname().
void octave_env::do_set_program_name | ( | const std::string & | s | ) | const [private] |
Definition at line 220 of file oct-env.cc.
References file_ops::dir_sep_chars(), prog_invocation_name, prog_name, and set_program_name().
Referenced by set_program_name().
void octave_env::error | ( | const std::string & | s | ) | const [private] |
Definition at line 544 of file oct-env.cc.
void octave_env::error | ( | int | err_num | ) | const [private] |
Definition at line 538 of file oct-env.cc.
std::string octave_env::get_current_directory | ( | void | ) | [static] |
Definition at line 139 of file oct-env.cc.
References do_getcwd(), instance, and instance_ok().
Referenced by DEFUN(), and command_editor::do_decode_prompt_string().
std::string octave_env::get_home_directory | ( | void | ) | [static] |
Definition at line 146 of file oct-env.cc.
References do_get_home_directory(), instance, and instance_ok().
Referenced by default_history_file(), DEFUN(), command_editor::do_decode_prompt_string(), execute_startup_files(), and tilde_expand_word().
std::string octave_env::get_host_name | ( | void | ) | [static] |
Definition at line 181 of file oct-env.cc.
References do_get_host_name(), instance, and instance_ok().
Referenced by default_history_timestamp_format(), default_save_header_format(), DEFUN(), and command_editor::do_decode_prompt_string().
std::string octave_env::get_program_invocation_name | ( | void | ) | [static] |
Definition at line 160 of file oct-env.cc.
References instance, instance_ok(), and prog_invocation_name.
Referenced by maybe_initialize_magick(), and octave_main().
std::string octave_env::get_program_name | ( | void | ) | [static] |
Definition at line 153 of file oct-env.cc.
References instance, instance_ok(), and prog_name.
Referenced by command_editor::do_decode_prompt_string(), and octave_main().
std::string octave_env::get_user_name | ( | void | ) | [static] |
Definition at line 174 of file oct-env.cc.
References do_get_user_name(), instance, and instance_ok().
Referenced by default_history_timestamp_format(), default_save_header_format(), and command_editor::do_decode_prompt_string().
std::string octave_env::getenv | ( | const std::string & | name | ) | [static] |
Definition at line 192 of file oct-env.cc.
References do_getenv(), instance, and instance_ok().
Referenced by default_history_file(), default_history_size(), default_pager(), DEFUN(), do_getenv(), load_path::do_initialize(), execute_startup_files(), get_P_tmpdir(), have_x11_display(), initialize_history(), initialize_pathsearch(), kpse_expand_kpse_dot(), kpse_tilde_expand(), kpse_var_value(), set_default_doc_cache_file(), set_default_editor(), set_default_info_file(), set_default_info_prog(), set_exec_path(), set_image_path(), set_local_site_defaults_file(), set_octave_home(), and set_site_defaults_file().
bool octave_env::have_x11_display | ( | void | ) | [static] |
Definition at line 205 of file oct-env.cc.
References getenv().
bool octave_env::instance_ok | ( | void | ) | [static, private] |
Definition at line 80 of file oct-env.cc.
References singleton_cleanup_list::add(), cleanup_instance(), instance, and octave_env().
Referenced by absolute_pathname(), base_pathname(), chdir(), get_current_directory(), get_home_directory(), get_host_name(), get_program_invocation_name(), get_program_name(), get_user_name(), getenv(), make_absolute(), polite_directory_format(), rooted_relative_pathname(), and set_program_name().
std::string octave_env::make_absolute | ( | const std::string & | s, | |
const std::string & | dot_path = get_current_directory () | |||
) | [static] |
Definition at line 132 of file oct-env.cc.
References do_make_absolute(), instance, and instance_ok().
Referenced by contents_file_in_path(), DEFUN(), DEFUN_DLD(), do_stream_open(), execute_startup_files(), file_in_path(), find_file_to_load(), make_absolute(), octave_canonicalize_file_name(), read_mat5_binary_element(), search_path_for_all_files(), and search_path_for_file().
octave_env& octave_env::operator= | ( | const octave_env & | ) | [private] |
void octave_env::pathname_backup | ( | std::string & | path, | |
int | n | |||
) | const [private] |
Definition at line 516 of file oct-env.cc.
References file_ops::is_dir_sep().
Referenced by do_make_absolute().
std::string octave_env::polite_directory_format | ( | const std::string & | name | ) | [static] |
Definition at line 104 of file oct-env.cc.
References do_polite_directory_format(), instance, and instance_ok().
void octave_env::putenv | ( | const std::string & | name, | |
const std::string & | value | |||
) | [static] |
Definition at line 199 of file oct-env.cc.
References octave_putenv().
Referenced by DEFUN(), and set_exec_path().
bool octave_env::rooted_relative_pathname | ( | const std::string & | s | ) | [static] |
Definition at line 118 of file oct-env.cc.
References do_rooted_relative_pathname(), instance, and instance_ok().
Referenced by DEFUN(), load_path::do_find_all_first_of(), load_path::do_find_dir(), load_path::do_find_file(), load_path::do_find_first_of(), load_path::do_find_matching_dirs(), do_stream_open(), and find_file_to_load().
void octave_env::set_program_name | ( | const std::string & | s | ) | [static] |
Definition at line 167 of file oct-env.cc.
References do_set_program_name(), instance, and instance_ok().
Referenced by do_set_program_name(), and octave_main().
std::string octave_env::current_directory [mutable, private] |
Definition at line 130 of file oct-env.h.
Referenced by do_chdir(), and do_getcwd().
bool octave_env::follow_symbolic_links [private] |
Definition at line 123 of file oct-env.h.
Referenced by do_chdir(), and do_getcwd().
std::string octave_env::host_name [mutable, private] |
Definition at line 139 of file oct-env.h.
Referenced by do_get_host_name().
octave_env * octave_env::instance = 0 [static, private] |
Definition at line 116 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_user_name(), getenv(), instance_ok(), make_absolute(), polite_directory_format(), rooted_relative_pathname(), and set_program_name().
std::string octave_env::prog_invocation_name [mutable, private] |
Definition at line 135 of file oct-env.h.
Referenced by do_set_program_name(), and get_program_invocation_name().
std::string octave_env::prog_name [mutable, private] |
Definition at line 133 of file oct-env.h.
Referenced by do_set_program_name(), and get_program_name().
std::string octave_env::user_name [mutable, private] |
Definition at line 137 of file oct-env.h.
Referenced by do_get_user_name().
bool octave_env::verbatim_pwd [private] |
Definition at line 127 of file oct-env.h.
Referenced by do_getcwd().