GNU Octave
10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Loading...
Searching...
No Matches
procstream.cc
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 1993-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 (HAVE_CONFIG_H)
27
# include "config.h"
28
#endif
29
30
#include <iomanip>
31
32
#include "
procstream.h
"
33
34
OCTAVE_BEGIN_NAMESPACE
(octave)
35
36
procstreambase
::
procstreambase
(const std::
string
& command,
int
mode)
37
{
38
pb_init ();
39
40
if
(! m_pb.open (command.c_str (), mode))
41
std::ios::setstate (std::ios::badbit);
42
}
43
44
procstreambase::procstreambase
(
const
char
*command,
int
mode)
45
{
46
pb_init ();
47
48
if
(! m_pb.
open
(command, mode))
49
std::ios::setstate (std::ios::badbit);
50
}
51
52
void
53
procstreambase::open
(
const
char
*command,
int
mode)
54
{
55
clear ();
56
57
if
(! m_pb.
open
(command, mode))
58
std::ios::setstate (std::ios::badbit);
59
}
60
61
int
62
procstreambase::close
()
63
{
64
int
status = 0;
65
66
if
(
is_open
())
67
{
68
if
(! m_pb.
close
())
69
std::ios::setstate (std::ios::failbit);
70
71
status = m_pb.
wait_status
();
72
}
73
74
return
status;
75
}
76
77
OCTAVE_END_NAMESPACE(octave)
procbuf::close
procbuf * close()
Definition
oct-procbuf.cc:185
procbuf::open
procbuf * open(const char *command, int mode)
Definition
oct-procbuf.cc:79
procbuf::wait_status
int wait_status() const
Definition
oct-procbuf.h:62
procstreambase
Definition
procstream.h:41
procstreambase::open
void open(const std::string &name, int mode)
Definition
procstream.h:54
procstreambase::procstreambase
procstreambase()
Definition
procstream.h:44
procstreambase::is_open
int is_open() const
Definition
procstream.h:61
procstreambase::close
int close()
Definition
procstream.cc:62
OCTAVE_BEGIN_NAMESPACE
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
procstream.h
libinterp
corefcn
procstream.cc
Generated on Sat Aug 2 2025 06:52:11 for GNU Octave by
1.9.8