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
Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
octave::sys::env Class Reference

#include "oct-env.h"

Collaboration diagram for octave::sys::env:
Collaboration graph
[legend]

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_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

 env (const 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_temp_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 (int) const
 
void error (const std::string &) const
 
envoperator= (const 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 envinstance = 0
 

Detailed Description

Definition at line 34 of file oct-env.h.

Constructor & Destructor Documentation

octave::sys::env::env ( void  )
protected

Definition at line 64 of file oct-env.cc.

References do_get_host_name(), do_get_user_name(), and do_getcwd().

Referenced by instance_ok().

octave::sys::env::env ( const env )
private

Member Function Documentation

bool octave::sys::env::absolute_pathname ( const std::string s)
static
std::string octave::sys::env::base_pathname ( const std::string s)
static
bool octave::sys::env::chdir ( const std::string newdir)
static

Definition at line 256 of file oct-env.cc.

References do_chdir(), instance, and instance_ok().

Referenced by octave_change_to_directory().

static void octave::sys::env::cleanup_instance ( void  )
inlinestaticprivate

Definition at line 128 of file oct-env.h.

Referenced by instance_ok().

bool octave::sys::env::do_absolute_pathname ( const std::string s) const
private
std::string octave::sys::env::do_base_pathname ( const std::string s) const
private
bool octave::sys::env::do_chdir ( const std::string newdir)
private
std::string octave::sys::env::do_get_home_directory ( void  ) const
private
std::string octave::sys::env::do_get_host_name ( void  ) const
private

Definition at line 517 of file oct-env.cc.

References host_name, and octave_gethostname_wrapper().

Referenced by env(), and get_host_name().

std::string octave::sys::env::do_get_temp_directory ( void  ) const
private

Definition at line 192 of file oct-env.cc.

References do_getenv(), and string.

Referenced by get_temp_directory().

std::string octave::sys::env::do_get_user_name ( void  ) const
private
std::string octave::sys::env::do_getcwd ( void  ) const
private
std::string octave::sys::env::do_getenv ( const std::string name) const
private

Definition at line 532 of file oct-env.cc.

References getenv(), and value().

Referenced by do_get_home_directory(), do_get_temp_directory(), and getenv().

std::string octave::sys::env::do_make_absolute ( const std::string s,
const std::string dot_path 
) const
private
std::string octave::sys::env::do_polite_directory_format ( const std::string name) const
private
void octave::sys::env::do_putenv ( const std::string name,
const std::string value 
) const
private
bool octave::sys::env::do_rooted_relative_pathname ( const std::string s) const
private

Definition at line 339 of file oct-env.cc.

References octave::sys::file_ops::is_dir_sep().

Referenced by do_base_pathname(), and rooted_relative_pathname().

void octave::sys::env::do_set_program_name ( const std::string s) const
private
void octave::sys::env::error ( int  err_num) const
private

Definition at line 606 of file oct-env.cc.

void octave::sys::env::error ( const std::string s) const
private

Definition at line 612 of file oct-env.cc.

std::string octave::sys::env::get_current_directory ( void  )
static
std::string octave::sys::env::get_home_directory ( void  )
static
std::string octave::sys::env::get_host_name ( void  )
static
std::string octave::sys::env::get_program_invocation_name ( void  )
static

Definition at line 164 of file oct-env.cc.

References instance, instance_ok(), and prog_invocation_name.

Referenced by maybe_initialize_magick().

std::string octave::sys::env::get_program_name ( void  )
static

Definition at line 157 of file oct-env.cc.

References instance, instance_ok(), and prog_name.

Referenced by octave::command_editor::do_decode_prompt_string().

std::string octave::sys::env::get_temp_directory ( void  )
static

Definition at line 150 of file oct-env.cc.

References do_get_temp_directory(), instance, and instance_ok().

Referenced by octave::sys::tempnam().

std::string octave::sys::env::get_user_name ( void  )
static
std::string octave::sys::env::getenv ( const std::string name)
static
bool octave::sys::env::have_x11_display ( void  )
static

Definition at line 248 of file oct-env.cc.

References getenv(), and string.

bool octave::sys::env::instance_ok ( void  )
staticprivate
std::string octave::sys::env::make_absolute ( const std::string s,
const std::string dot_path = get_current_directory () 
)
static
env& octave::sys::env::operator= ( const env )
private
void octave::sys::env::pathname_backup ( std::string path,
int  n 
) const
private

Definition at line 584 of file oct-env.cc.

References octave::sys::file_ops::is_dir_sep().

Referenced by do_make_absolute().

std::string octave::sys::env::polite_directory_format ( const std::string name)
static
void octave::sys::env::putenv ( const std::string name,
const std::string value 
)
static

Definition at line 242 of file oct-env.cc.

References octave_putenv().

Referenced by octave::gui_application::execute(), Fsetenv(), and set_exec_path().

bool octave::sys::env::rooted_relative_pathname ( const std::string s)
static
void octave::sys::env::set_program_name ( const std::string s)
static

Definition at line 171 of file oct-env.cc.

References do_set_program_name(), instance, and instance_ok().

Referenced by main(), and octave_main().

Member Data Documentation

std::string octave::sys::env::current_directory
mutableprivate

Definition at line 139 of file oct-env.h.

Referenced by do_chdir(), and do_getcwd().

bool octave::sys::env::follow_symbolic_links
private

Definition at line 132 of file oct-env.h.

Referenced by do_chdir(), and do_getcwd().

std::string octave::sys::env::host_name
mutableprivate

Definition at line 148 of file oct-env.h.

Referenced by do_get_host_name().

env * octave::sys::env::instance = 0
staticprivate
std::string octave::sys::env::prog_invocation_name
mutableprivate

Definition at line 144 of file oct-env.h.

Referenced by do_set_program_name(), and get_program_invocation_name().

std::string octave::sys::env::prog_name
mutableprivate

Definition at line 142 of file oct-env.h.

Referenced by do_set_program_name(), and get_program_name().

std::string octave::sys::env::user_name
mutableprivate

Definition at line 146 of file oct-env.h.

Referenced by do_get_user_name().

bool octave::sys::env::verbatim_pwd
private

Definition at line 136 of file oct-env.h.

Referenced by do_getcwd().


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