GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
oct-uname.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2005-2017 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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_oct_uname_h)
24 #define octave_oct_uname_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 namespace octave
31 {
32  namespace sys
33  {
34  class
35  OCTAVE_API
36  uname
37  {
38  public:
39 
40  uname (void)
41  : m_sysname ("unknown"), m_nodename ("unknown"),
42  m_release ("unknown"), m_version ("unknown"),
43  m_machine ("unknown"),
44  msg ("uname not supported on this system"), err (-1)
45  { init (); }
46 
47  uname (const uname& unm)
48  : m_sysname (unm.m_sysname), m_nodename (unm.m_nodename),
49  m_release (unm.m_release), m_version (unm.m_version),
50  m_machine (unm.m_machine), msg (unm.msg), err (unm.err)
51  { }
52 
53  uname& operator = (const uname& unm)
54  {
55  if (this != &unm)
56  {
57  m_sysname = unm.m_sysname;
58  m_nodename = unm.m_nodename;
59  m_release = unm.m_release;
60  m_version = unm.m_version;
61  m_machine = unm.m_machine;
62 
63  msg = unm.msg;
64  err = unm.err;
65  }
66 
67  return *this;
68  }
69 
70  ~uname (void) { }
71 
72  std::string sysname (void) const { return m_sysname; }
73  std::string nodename (void) const { return m_nodename; }
74  std::string release (void) const { return m_release; }
75  std::string version (void) const { return m_version; }
76  std::string machine (void) const { return m_machine; }
77 
78  std::string message (void) const { return msg; }
79  int error (void) const { return err; }
80 
81  private:
82 
88 
90  int err;
91 
92  void init (void);
93  };
94  }
95 }
96 
97 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
98 
99 OCTAVE_DEPRECATED ("use 'octave::sys::uname' instead")
100 typedef octave::sys::uname octave_uname;
101 
102 #endif
103 
104 #endif
int error(void) const
Definition: oct-uname.h:79
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
std::string m_sysname
Definition: oct-uname.h:83
std::string sysname(void) const
Definition: oct-uname.h:72
std::string version(void) const
Definition: oct-uname.h:75
std::string m_version
Definition: oct-uname.h:86
std::string nodename(void) const
Definition: oct-uname.h:73
std::string msg
Definition: oct-uname.h:89
uname(const uname &unm)
Definition: oct-uname.h:47
std::string m_release
Definition: oct-uname.h:85
OCTAVE_EXPORT octave_value_list error nd deftypefn *const octave_scalar_map err
Definition: error.cc:1036
std::string m_nodename
Definition: oct-uname.h:84
std::string m_machine
Definition: oct-uname.h:87
std::string machine(void) const
Definition: oct-uname.h:76
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
std::string release(void) const
Definition: oct-uname.h:74
std::string message(void) const
Definition: oct-uname.h:78