5547
|
1 /* |
|
2 |
|
3 Copyright (C) 2005 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_uame_h) |
|
25 #define octave_uname_h 1 |
|
26 |
|
27 #include <string> |
|
28 |
|
29 class |
|
30 octave_uname |
|
31 { |
|
32 public: |
|
33 |
|
34 octave_uname (void) |
|
35 : utsname_sysname ("unknown"), utsname_nodename ("unknown"), |
|
36 utsname_release ("unknown"), utsname_version ("unknown"), |
|
37 utsname_machine ("unknown"), |
|
38 msg ("uname not supported on this system"), err (-1) |
|
39 { init (); } |
|
40 |
|
41 octave_uname (const octave_uname& unm) |
|
42 : utsname_sysname (unm.utsname_sysname), |
|
43 utsname_nodename (unm.utsname_nodename), |
|
44 utsname_release (unm.utsname_release), |
|
45 utsname_version (unm.utsname_version), |
|
46 utsname_machine (unm.utsname_machine), |
|
47 msg (unm.msg), err (unm.err) |
|
48 { } |
|
49 |
|
50 octave_uname& operator = (const octave_uname& unm) |
|
51 { |
|
52 if (this != &unm) |
|
53 { |
|
54 utsname_sysname = unm.utsname_sysname; |
|
55 utsname_nodename = unm.utsname_nodename; |
|
56 utsname_release = unm.utsname_release; |
|
57 utsname_version = unm.utsname_version; |
|
58 utsname_machine = unm.utsname_machine; |
|
59 |
|
60 msg = unm.msg; |
|
61 err = unm.err; |
|
62 } |
|
63 |
|
64 return *this; |
|
65 } |
|
66 |
|
67 ~octave_uname (void) { } |
|
68 |
|
69 std::string sysname (void) const { return utsname_sysname; } |
|
70 std::string nodename (void) const { return utsname_nodename; } |
|
71 std::string release (void) const { return utsname_release; } |
|
72 std::string version (void) const { return utsname_version; } |
|
73 std::string machine (void) const { return utsname_machine; } |
|
74 |
|
75 std::string message (void) const { return msg; } |
|
76 int error (void) const { return err; } |
|
77 |
|
78 private: |
|
79 |
|
80 std::string utsname_sysname; |
|
81 std::string utsname_nodename; |
|
82 std::string utsname_release; |
|
83 std::string utsname_version; |
|
84 std::string utsname_machine; |
|
85 |
|
86 std::string msg; |
|
87 int err; |
|
88 |
|
89 void init (void); |
|
90 }; |
|
91 |
|
92 #endif |
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; End: *** |
|
98 */ |