GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-uname.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2005-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_oct_uname_h)
27 #define octave_oct_uname_h 1
28 
29 #include "octave-config.h"
30 
31 #include <string>
32 
33 namespace octave
34 {
35  namespace sys
36  {
37  class
38  OCTAVE_API
39  uname
40  {
41  public:
42 
43  uname (void)
44  : m_sysname ("unknown"), m_nodename ("unknown"),
45  m_release ("unknown"), m_version ("unknown"),
46  m_machine ("unknown"),
47  msg ("uname not supported on this system"), err (-1)
48  { init (); }
49 
50  uname (const uname& unm)
51  : m_sysname (unm.m_sysname), m_nodename (unm.m_nodename),
52  m_release (unm.m_release), m_version (unm.m_version),
53  m_machine (unm.m_machine), msg (unm.msg), err (unm.err)
54  { }
55 
56  uname& operator = (const uname& unm)
57  {
58  if (this != &unm)
59  {
60  m_sysname = unm.m_sysname;
61  m_nodename = unm.m_nodename;
62  m_release = unm.m_release;
63  m_version = unm.m_version;
64  m_machine = unm.m_machine;
65 
66  msg = unm.msg;
67  err = unm.err;
68  }
69 
70  return *this;
71  }
72 
73  ~uname (void) = default;
74 
75  std::string sysname (void) const { return m_sysname; }
76  std::string nodename (void) const { return m_nodename; }
77  std::string release (void) const { return m_release; }
78  std::string version (void) const { return m_version; }
79  std::string machine (void) const { return m_machine; }
80 
81  std::string message (void) const { return msg; }
82  int error (void) const { return err; }
83 
84  private:
85 
86  std::string m_sysname;
87  std::string m_nodename;
88  std::string m_release;
89  std::string m_version;
90  std::string m_machine;
91 
92  std::string msg;
93  int err;
94 
95  void init (void);
96  };
97  }
98 }
99 
100 #endif
std::string m_nodename
Definition: oct-uname.h:87
std::string machine(void) const
Definition: oct-uname.h:79
std::string m_release
Definition: oct-uname.h:88
std::string release(void) const
Definition: oct-uname.h:77
std::string nodename(void) const
Definition: oct-uname.h:76
std::string version(void) const
Definition: oct-uname.h:78
uname(const uname &unm)
Definition: oct-uname.h:50
std::string m_version
Definition: oct-uname.h:89
std::string message(void) const
Definition: oct-uname.h:81
~uname(void)=default
int error(void) const
Definition: oct-uname.h:82
std::string msg
Definition: oct-uname.h:92
std::string m_sysname
Definition: oct-uname.h:86
std::string sysname(void) const
Definition: oct-uname.h:75
std::string m_machine
Definition: oct-uname.h:90