GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
oct-strstrm.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-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 "oct-strstrm.h"
31
33
34// Position a stream at OFFSET relative to ORIGIN.
35
36int
38{
39 // Note: error is inherited from base_stream, not ::error.
40 // This error function does not halt execution so "return ..." must exist.
41 error ("fseek: invalid operation");
42 return -1;
43}
44
45// Return current stream position.
46
47off_t
49{
50 // Note: error is inherited from base_stream, not ::error.
51 // This error function does not halt execution so "return ..." must exist.
52 error ("ftell: invalid operation");
53 return -1;
54}
55
57istrstream::create (const char *data, std::ios::openmode arg_md,
58 mach_info::float_format flt_fmt,
59 const std::string& encoding)
60{
61 return stream (new istrstream (data, arg_md, flt_fmt, encoding));
62}
63
65istrstream::create (const std::string& data, std::ios::openmode arg_md,
66 mach_info::float_format flt_fmt,
67 const std::string& encoding)
68{
69 return stream (new istrstream (data, arg_md, flt_fmt, encoding));
70}
71
73ostrstream::create (std::ios::openmode arg_md,
74 mach_info::float_format flt_fmt,
75 const std::string& encoding)
76{
77 return stream (new ostrstream (arg_md, flt_fmt, encoding));
78}
79
80OCTAVE_END_NAMESPACE(octave)
std::string encoding() const
Definition oct-stream.h:184
std::string error(bool clear, int &err_num)
friend class stream
Definition oct-stream.h:68
virtual off_t tell()
int seek(off_t, int)
static stream create(const char *data, std::ios::openmode arg_md=std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8")
static stream create(std::ios::openmode arg_md=std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8")
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn