00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __MMX_SYSTEM_HPP
00014 #define __MMX_SYSTEM_HPP
00015 #include <basix/string.hpp>
00016 #include <basix/vector.hpp>
00017
00019
00020 namespace mmx {
00021
00022 extern char* command_name;
00023 string get_env (const string& var);
00024 int set_env (const string& var, const string& value);
00025 string get_pid ();
00026 int system (const string& s);
00027 void init_system ();
00028 string user_dir ();
00029 string prefix_dir ();
00030 string sysconf_dir ();
00031 string load_path ();
00032 string eval_system (const string& s);
00033 int exec (const vector<string>& v);
00034
00035 bool file_test (const string& file_name, const string& attrs);
00036 bool file_exists (const string& file_name);
00037 bool file_is_file (const string& file_name);
00038 bool file_is_directory (const string& file_name);
00039 bool file_is_script (const string& file_name);
00040 double file_last_modified (const string& file_name);
00041 string decode_name (const string& name);
00042 string canonical_name (const string& name);
00043 string path_name (const string& file_path, const string& file_name);
00044 string get_directory (const string& name);
00045 string strip_directory (const string& name);
00046 string get_extension (const string& name);
00047 string strip_extension (const string& name);
00048 string relative_name (const string& base, const string& name);
00049 string resolve_name (const string& base, const string& name);
00050 string follow_link (const string& name, const bool& recurse);
00051
00052 bool load (const string& file_name, string& s);
00053 bool load (const string& fp, const string& file_name, string& s);
00054 bool save (const string& file_name, const string& s);
00055 bool load_directory (const string& name, vector<string>& s);
00056 bool mkdir (const string& orig_name);
00057
00058 extern void (*embedded_link) (const string& name);
00059 string dl_suffix ();
00060 string dl_option ();
00061 bool dl_exists (const string& name);
00062 bool dl_linked (const string& name);
00063 void dl_link (const string& name, const string& init);
00064 void dl_link (const string& name);
00065 void include (const string& name);
00066
00067 }
00068 #endif // __MMX_SYSTEM_HPP