oct-prcstrm.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1996-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include <cstdio>
00028 
00029 #include "oct-prcstrm.h"
00030 #include "sysdep.h"
00031 
00032 octave_stream
00033 octave_iprocstream::create (const std::string& n, std::ios::openmode arg_md,
00034                             oct_mach_info::float_format ff)
00035 {
00036   return octave_stream (new octave_iprocstream (n, arg_md, ff));
00037 }
00038 
00039 octave_iprocstream::octave_iprocstream (const std::string& n,
00040                                         std::ios::openmode arg_md,
00041                                         oct_mach_info::float_format ff)
00042   : octave_stdiostream (n, octave_popen (n.c_str (), "r"),
00043                         arg_md, ff, octave_pclose)
00044 {
00045 }
00046 
00047 octave_iprocstream::~octave_iprocstream (void)
00048 {
00049   do_close ();
00050 }
00051 
00052 octave_stream
00053 octave_oprocstream::create (const std::string& n, std::ios::openmode arg_md,
00054                             oct_mach_info::float_format ff)
00055 {
00056   return octave_stream (new octave_oprocstream (n, arg_md, ff));
00057 }
00058 
00059 octave_oprocstream::octave_oprocstream (const std::string& n,
00060                                         std::ios::openmode arg_md,
00061                                         oct_mach_info::float_format ff)
00062   : octave_stdiostream (n, octave_popen (n.c_str (), "w"),
00063                         arg_md, ff, octave_pclose)
00064 {
00065 }
00066 
00067 octave_oprocstream::~octave_oprocstream (void)
00068 {
00069   do_close ();
00070 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines