00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_uame_h)
00024 #define octave_uname_h 1
00025
00026 #include <string>
00027
00028 class
00029 OCTAVE_API
00030 octave_uname
00031 {
00032 public:
00033
00034 octave_uname (void)
00035 : utsname_sysname ("unknown"), utsname_nodename ("unknown"),
00036 utsname_release ("unknown"), utsname_version ("unknown"),
00037 utsname_machine ("unknown"),
00038 msg ("uname not supported on this system"), err (-1)
00039 { init (); }
00040
00041 octave_uname (const octave_uname& unm)
00042 : utsname_sysname (unm.utsname_sysname),
00043 utsname_nodename (unm.utsname_nodename),
00044 utsname_release (unm.utsname_release),
00045 utsname_version (unm.utsname_version),
00046 utsname_machine (unm.utsname_machine),
00047 msg (unm.msg), err (unm.err)
00048 { }
00049
00050 octave_uname& operator = (const octave_uname& unm)
00051 {
00052 if (this != &unm)
00053 {
00054 utsname_sysname = unm.utsname_sysname;
00055 utsname_nodename = unm.utsname_nodename;
00056 utsname_release = unm.utsname_release;
00057 utsname_version = unm.utsname_version;
00058 utsname_machine = unm.utsname_machine;
00059
00060 msg = unm.msg;
00061 err = unm.err;
00062 }
00063
00064 return *this;
00065 }
00066
00067 ~octave_uname (void) { }
00068
00069 std::string sysname (void) const { return utsname_sysname; }
00070 std::string nodename (void) const { return utsname_nodename; }
00071 std::string release (void) const { return utsname_release; }
00072 std::string version (void) const { return utsname_version; }
00073 std::string machine (void) const { return utsname_machine; }
00074
00075 std::string message (void) const { return msg; }
00076 int error (void) const { return err; }
00077
00078 private:
00079
00080 std::string utsname_sysname;
00081 std::string utsname_nodename;
00082 std::string utsname_release;
00083 std::string utsname_version;
00084 std::string utsname_machine;
00085
00086 std::string msg;
00087 int err;
00088
00089 void init (void);
00090 };
00091
00092 #endif
00093
00094
00095
00096
00097
00098