GNU Octave 11.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-2026 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
35
37{
38public:
39
41 : m_sysname ("unknown"), m_nodename ("unknown"),
42 m_release ("unknown"), m_version ("unknown"),
43 m_machine ("unknown"),
44 m_errmsg ("uname not supported on this system"), m_errno (-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),
51 m_errmsg (unm.m_errmsg), m_errno (unm.m_errno)
52 { }
53
54 uname& operator = (const uname& unm)
55 {
56 if (this != &unm)
57 {
58 m_sysname = unm.m_sysname;
59 m_nodename = unm.m_nodename;
60 m_release = unm.m_release;
61 m_version = unm.m_version;
62 m_machine = unm.m_machine;
63
64 m_errmsg = unm.m_errmsg;
65 m_errno = unm.m_errno;
66 }
67
68 return *this;
69 }
70
71 ~uname () = default;
72
73 std::string sysname () const { return m_sysname; }
74 std::string nodename () const { return m_nodename; }
75 std::string release () const { return m_release; }
76 std::string version () const { return m_version; }
77 std::string machine () const { return m_machine; }
78
79 std::string message () const { return m_errmsg; }
80 int error () const { return m_errno; }
81
82private:
83
84 std::string m_sysname;
85 std::string m_nodename;
86 std::string m_release;
87 std::string m_version;
88 std::string m_machine;
89
90 std::string m_errmsg;
91 int m_errno;
92
93 void init ();
94};
95
96OCTAVE_END_NAMESPACE(sys)
97OCTAVE_END_NAMESPACE(octave)
98
99#endif
std::string release() const
Definition oct-uname.h:75
uname()
Definition oct-uname.h:40
std::string version() const
Definition oct-uname.h:76
std::string nodename() const
Definition oct-uname.h:74
std::string message() const
Definition oct-uname.h:79
~uname()=default
std::string machine() const
Definition oct-uname.h:77
uname(const uname &unm)
Definition oct-uname.h:47
int error() const
Definition oct-uname.h:80
std::string sysname() const
Definition oct-uname.h:73
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55