basix_doc 0.1
|
00001 00002 /****************************************************************************** 00003 * MODULE : system.hpp 00004 * DESCRIPTION: Operating system related routines 00005 * COPYRIGHT : (C) 2003 Joris van der Hoeven 00006 ******************************************************************************* 00007 * This software falls under the GNU general public license and comes WITHOUT 00008 * ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details. 00009 * If you don't have this file, write to the Free Software Foundation, Inc., 00010 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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 string get_env (const string& var); 00023 int set_env (const string& var, const string& value); 00024 int system (const string& s); 00025 void init_system (); 00026 string user_dir (); 00027 string prefix_dir (); 00028 string sysconf_dir (); 00029 string load_path (); 00030 string eval_system (const string& s); 00031 00032 bool file_test (const string& file_name, const string& attrs); 00033 bool file_exists (const string& file_name); 00034 bool file_is_file (const string& file_name); 00035 bool file_is_directory (const string& file_name); 00036 bool file_is_script (const string& file_name); 00037 double file_last_modified (const string& file_name); 00038 string decode_name (const string& name); 00039 string path_name (const string& file_path, const string& file_name); 00040 string get_directory (const string& name); 00041 string strip_directory (const string& name); 00042 string get_extension (const string& name); 00043 string strip_extension (const string& name); 00044 string relative_name (const string& base, const string& name); 00045 string resolve_name (const string& base, const string& name); 00046 string follow_link (const string& name, const bool& recurse); 00047 00048 bool load (const string& file_name, string& s); 00049 bool load (const string& fp, const string& file_name, string& s); 00050 bool save (const string& file_name, const string& s); 00051 bool load_directory (const string& name, vector<string>& s); 00052 bool mkdir (const string& orig_name); 00053 00054 extern void (*embedded_link) (const string& name); 00055 string dl_suffix (); 00056 string dl_option (); 00057 bool dl_exists (const string& name); 00058 void dl_link (const string& name, const string& init); 00059 void dl_link (const string& name); 00060 void include (const string& name); 00061 00062 } // namespace mmx 00063 #endif // __MMX_SYSTEM_HPP