26 #if ! defined (octave_oct_env_h)
27 #define octave_oct_env_h 1
29 #include "octave-config.h"
47 OCTAVE_DISABLE_COPY_MOVE (
env)
51 static std::string polite_directory_format (
const std::string& name);
53 static bool absolute_pathname (
const std::string& s);
55 static bool rooted_relative_pathname (
const std::string& s);
57 static std::string base_pathname (
const std::string& s);
60 make_absolute (
const std::string& s,
61 const std::string& dot_path = get_current_directory ());
63 static std::string get_current_directory ();
65 static std::string get_home_directory ();
67 static std::string get_temp_directory ();
69 static std::string get_user_config_directory ();
71 static std::string get_user_data_directory ();
73 static std::string get_program_name ();
75 static std::string get_program_invocation_name ();
77 static std::string get_user_name ();
79 static std::string get_host_name ();
81 static std::string getenv (
const std::string& name);
83 static bool isenv (
const std::string& name);
85 static void putenv (
const std::string& name,
const std::string& value);
87 static bool have_x11_display ();
89 static bool chdir (
const std::string& newdir);
91 static void set_program_name (
const std::string& s);
95 static bool instance_ok ();
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 ();
110 std::string do_get_home_directory ();
112 std::string do_get_temp_directory ()
const;
114 std::string do_get_user_config_directory ();
116 std::string do_get_user_data_directory ();
118 std::string do_get_user_name ();
120 std::string do_get_host_name ();
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;
137 static env *s_instance;
139 static void cleanup_instance ()
140 {
delete s_instance; s_instance =
nullptr; }
144 bool m_follow_symbolic_links;
151 std::string m_current_directory;
154 std::string m_prog_name;
156 std::string m_prog_invocation_name;
158 std::string m_user_name;
160 std::string m_host_name;
163 OCTAVE_END_NAMESPACE(sys)
164 OCTAVE_END_NAMESPACE(
octave)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)
int chdir(const std::string &path_arg)