GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::sys::env Class Reference

#include "oct-env.h"

Collaboration diagram for octave::sys::env:

Public Member Functions

 env (const env &)=delete
 
envoperator= (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_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_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
 
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 = nullptr
 

Detailed Description

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

Constructor & Destructor Documentation

◆ env() [1/2]

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().

◆ env() [2/2]

octave::sys::env::env ( const env )
delete

Member Function Documentation

◆ absolute_pathname()

◆ base_pathname()

std::string octave::sys::env::base_pathname ( const std::string s)
static

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

References do_base_pathname(), instance, instance_ok(), and s.

Referenced by octave::xzip().

◆ chdir()

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().

◆ cleanup_instance()

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

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

Referenced by instance_ok().

◆ do_absolute_pathname()

bool octave::sys::env::do_absolute_pathname ( const std::string s) const
private

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

References octave::sys::file_ops::is_dir_sep(), and s.

Referenced by absolute_pathname(), do_base_pathname(), and do_make_absolute().

◆ do_base_pathname()

std::string octave::sys::env::do_base_pathname ( const std::string s) const
private

◆ do_chdir()

bool octave::sys::env::do_chdir ( const std::string newdir)
private

◆ do_get_home_directory()

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

◆ do_get_host_name()

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().

◆ do_get_temp_directory()

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().

◆ do_get_user_name()

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

◆ do_getcwd()

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

◆ do_getenv()

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

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

References getenv(), name, and value.

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

◆ do_make_absolute()

std::string octave::sys::env::do_make_absolute ( const std::string s,
const std::string dot_path 
) const
private

◆ do_polite_directory_format()

std::string octave::sys::env::do_polite_directory_format ( const std::string name) const
private

◆ do_putenv()

void octave::sys::env::do_putenv ( const std::string name,
const std::string value 
) const
private

◆ do_rooted_relative_pathname()

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(), and s.

Referenced by do_base_pathname(), and rooted_relative_pathname().

◆ do_set_program_name()

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

◆ error() [1/2]

void octave::sys::env::error ( int  err_num) const
private

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

◆ error() [2/2]

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

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

References s.

◆ get_current_directory()

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

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

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

Referenced by initial_class_path(), and octave_change_to_directory().

◆ get_home_directory()

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

◆ get_host_name()

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

◆ get_program_invocation_name()

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().

◆ get_program_name()

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.

◆ get_temp_directory()

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().

◆ get_user_name()

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

◆ getenv()

◆ have_x11_display()

bool octave::sys::env::have_x11_display ( void  )
static

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

References getenv(), and string.

◆ instance_ok()

◆ make_absolute()

◆ operator=()

env& octave::sys::env::operator= ( const env )
delete

◆ pathname_backup()

void octave::sys::env::pathname_backup ( std::string path,
int  n 
) const
private

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

References i, and octave::sys::file_ops::is_dir_sep().

Referenced by do_make_absolute().

◆ polite_directory_format()

std::string octave::sys::env::polite_directory_format ( const std::string name)
static

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

References do_polite_directory_format(), instance, instance_ok(), and name.

◆ putenv()

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

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

References name, octave_putenv(), and value.

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

◆ rooted_relative_pathname()

◆ set_program_name()

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, instance_ok(), and s.

Referenced by main().

Member Data Documentation

◆ current_directory

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

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

Referenced by do_chdir(), and do_getcwd().

◆ follow_symbolic_links

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

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

Referenced by do_chdir(), and do_getcwd().

◆ host_name

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

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

Referenced by do_get_host_name().

◆ instance

◆ prog_invocation_name

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().

◆ prog_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().

◆ user_name

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

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

Referenced by do_get_user_name().

◆ verbatim_pwd

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: