GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
oct-uname.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2005-2025 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
34
36
38{
39public:
40
42 : m_sysname ("unknown"), m_nodename ("unknown"),
43 m_release ("unknown"), m_version ("unknown"),
44 m_machine ("unknown"),
45 m_errmsg ("uname not supported on this system"), m_errno (-1)
46 { init (); }
47
48 uname (const uname& unm)
49 : m_sysname (unm.m_sysname), m_nodename (unm.m_nodename),
50 m_release (unm.m_release), m_version (unm.m_version),
51 m_machine (unm.m_machine),
52 m_errmsg (unm.m_errmsg), m_errno (unm.m_errno)
53 { }
54
55 uname& operator = (const uname& unm)
56 {
57 if (this != &unm)
58 {
59 m_sysname = unm.m_sysname;
60 m_nodename = unm.m_nodename;
61 m_release = unm.m_release;
62 m_version = unm.m_version;
63 m_machine = unm.m_machine;
64
65 m_errmsg = unm.m_errmsg;
66 m_errno = unm.m_errno;
67 }
68
69 return *this;
70 }
71
72 ~uname () = default;
73
74 std::string sysname () const { return m_sysname; }
75 std::string nodename () const { return m_nodename; }
76 std::string release () const { return m_release; }
77 std::string version () const { return m_version; }
78 std::string machine () const { return m_machine; }
79
80 std::string message () const { return m_errmsg; }
81 int error () const { return m_errno; }
82
83private:
84
85 std::string m_sysname;
86 std::string m_nodename;
87 std::string m_release;
88 std::string m_version;
89 std::string m_machine;
90
91 std::string m_errmsg;
92 int m_errno;
93
94 void init ();
95};
96
97OCTAVE_END_NAMESPACE(sys)
98OCTAVE_END_NAMESPACE(octave)
99
100#endif
std::string release() const
Definition oct-uname.h:76
uname()
Definition oct-uname.h:41
std::string version() const
Definition oct-uname.h:77
std::string nodename() const
Definition oct-uname.h:75
std::string message() const
Definition oct-uname.h:80
~uname()=default
std::string machine() const
Definition oct-uname.h:78
uname(const uname &unm)
Definition oct-uname.h:48
int error() const
Definition oct-uname.h:81
std::string sysname() const
Definition oct-uname.h:74
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55