メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

oct-env.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_env_h)
00024 #define octave_env_h 1
00025 
00026 #include <string>
00027 
00028 class
00029 octave_env
00030 {
00031 protected:
00032 
00033   octave_env (void);
00034 
00035 public:
00036 
00037   static std::string polite_directory_format (const std::string& name);
00038 
00039   static bool absolute_pathname (const std::string& s);
00040 
00041   static std::string base_pathname (const std::string& s);
00042 
00043   static std::string make_absolute (const std::string& s,
00044                                     const std::string& dot_path);
00045 
00046   static std::string getcwd (void);
00047 
00048   static std::string get_home_directory (void);
00049 
00050   static std::string get_program_name (void);
00051 
00052   static std::string get_program_invocation_name (void);
00053 
00054   static std::string get_user_name (void);
00055 
00056   static std::string get_host_name (void);
00057 
00058   static std::string getenv (const std::string& name);
00059 
00060   static void putenv (const std::string& name, const std::string& value);
00061 
00062   static bool chdir (const std::string& newdir);
00063 
00064   static void set_program_name (const std::string& s);
00065 
00066 private:
00067 
00068   static bool instance_ok (void);
00069 
00070   std::string do_polite_directory_format (const std::string& name) const;
00071 
00072   bool do_absolute_pathname (const std::string& s) const;
00073 
00074   std::string do_base_pathname (const std::string& s) const;
00075 
00076   std::string do_make_absolute (const std::string& s,
00077                                 const std::string& dot_path) const;
00078 
00079   std::string do_getcwd (void) const;
00080 
00081   std::string do_get_home_directory (void) const;
00082 
00083   std::string do_get_user_name (void) const;
00084 
00085   std::string do_get_host_name (void) const;
00086 
00087   std::string do_getenv (const std::string& name) const;
00088 
00089   void do_putenv (const std::string& name, const std::string& value) const;
00090 
00091   bool do_chdir (const std::string& newdir);
00092 
00093   void do_set_program_name (const std::string& s) const;
00094 
00095   void pathname_backup (std::string& path, int n) const;
00096 
00097   void error (int) const;
00098 
00099   void error (const std::string&) const;
00100 
00101   // No copying!
00102 
00103   octave_env (const octave_env&);
00104 
00105   octave_env& operator = (const octave_env&);
00106 
00107   // The real thing.
00108   static octave_env *instance;
00109 
00110   // TRUE means follow symbolic links that point to directories just
00111   // as if they are real directories.
00112   bool follow_symbolic_links;
00113 
00114   // TRUE means that pwd always give verbatim directory, regardless
00115   // of symbolic link following.
00116   bool verbatim_pwd;
00117 
00118   // Where are we?
00119   mutable std::string current_directory;
00120 
00121   // Etc.
00122   mutable std::string program_name;
00123 
00124   mutable std::string program_invocation_name;
00125 
00126   mutable std::string user_name;
00127 
00128   mutable std::string host_name;
00129 };
00130 
00131 #endif
00132 
00133 /*
00134 ;;; Local Variables: ***
00135 ;;; mode: C++ ***
00136 ;;; End: ***
00137 */

Wed Dec 29 11:52:06 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送