26 #if ! defined (octave_oct_env_h)
27 #define octave_oct_env_h 1
29 #include "octave-config.h"
51 env& operator = (
const env&) =
delete;
53 static std::string polite_directory_format (
const std::string& name);
57 static bool rooted_relative_pathname (
const std::string& s);
59 static std::string base_pathname (
const std::string& s);
63 const std::string& dot_path = get_current_directory ());
65 static std::string get_current_directory (
void);
67 static std::string get_home_directory (
void);
71 static std::string get_user_config_directory (
void);
73 static std::string get_user_data_directory (
void);
75 static std::string get_program_name (
void);
77 static std::string get_program_invocation_name (
void);
79 static std::string get_user_name (
void);
81 static std::string get_host_name (
void);
83 static std::string getenv (
const std::string& name);
85 static void putenv (
const std::string& name,
const std::string& value);
87 static bool have_x11_display (
void);
89 static bool chdir (
const std::string& newdir);
91 static void set_program_name (
const std::string& s);
95 static bool instance_ok (
void);
97 std::string do_polite_directory_format (
const std::string& name);
99 bool do_absolute_pathname (
const std::string& s)
const;
101 bool do_rooted_relative_pathname (
const std::string& s)
const;
103 std::string do_base_pathname (
const std::string& s)
const;
105 std::string do_make_absolute (
const std::string& s,
106 const std::string& dot_path)
const;
108 std::string do_getcwd (
void);
110 std::string do_get_home_directory (
void);
112 std::string do_get_temp_directory (
void)
const;
114 std::string do_get_user_config_directory (
void);
116 std::string do_get_user_data_directory (
void);
118 std::string do_get_user_name (
void);
120 std::string do_get_host_name (
void);
122 std::string do_getenv (
const std::string& name)
const;
124 void do_putenv (
const std::string& name,
const std::string& value)
const;
126 bool do_chdir (
const std::string& newdir);
128 void do_set_program_name (
const std::string& s);
130 void pathname_backup (std::string& path,
int n)
const;
132 void error (
int)
const;
134 void error (
const std::string&)
const;
140 {
delete m_instance; m_instance =
nullptr; }
std::string m_prog_invocation_name
static void cleanup_instance(void)
std::string m_current_directory
void do_putenv(const std::string &name, const std::string &value) const
bool m_follow_symbolic_links
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void error(const char *fmt,...)
int chdir(const std::string &path_arg)
static std::string get_temp_directory(void)
static bool absolute_pathname(const std::string &s)
static string_vector make_absolute(const string_vector &sv)