26 #if ! defined (octave_oct_strstrm_h)
27 #define octave_oct_strstrm_h 1
29 #include "octave-config.h"
46 const std::string& encoding =
"utf-8")
59 int seek (off_t,
int);
63 virtual off_t tell ();
67 std::string
name ()
const {
return ""; }
69 virtual std::streambuf *
rdbuf () = 0;
71 virtual bool bad ()
const = 0;
82 std::ios::openmode arg_md = std::ios::out,
84 const std::string& encoding =
"utf-8")
88 std::ios::openmode arg_md = std::ios::out,
90 const std::string& encoding =
"utf-8")
93 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (
istrstream)
103 create (
const char *data, std::ios::openmode arg_md = std::ios::out,
105 const std::string& encoding =
"utf-8");
108 create (
const std::string& data, std::ios::openmode arg_md = std::ios::out,
110 const std::string& encoding =
"utf-8");
114 bool eof ()
const {
return m_istream.eof (); }
120 off_t
tell () {
return m_istream.tellg (); }
124 return m_istream ? m_istream.rdbuf () :
nullptr;
127 bool bad ()
const {
return m_istream.bad (); }
129 void clear () { m_istream.clear (); }
133 std::istringstream m_istream;
143 const std::string& encoding =
"utf-8")
155 create (std::ios::openmode arg_md = std::ios::out,
157 const std::string& encoding =
"utf-8");
161 bool eof ()
const {
return m_ostream.eof (); }
167 std::string
str () {
return m_ostream.str (); }
171 return m_ostream ? m_ostream.rdbuf () :
nullptr;
174 bool bad ()
const {
return m_ostream.bad (); }
176 void clear () { m_ostream.clear (); }
180 std::ostringstream m_ostream;
183 OCTAVE_END_NAMESPACE(
octave)
base_strstream(std::ios::openmode m=std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8")
virtual std::streambuf * rdbuf()=0
virtual bool bad() const =0
~base_strstream()=default
istrstream(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")
std::ostream * output_stream()
std::istream * input_stream()
istrstream(const std::string &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")
ostrstream(std::ios::openmode arg_md=std::ios::out, mach_info::float_format ff=mach_info::native_float_format(), const std::string &encoding="utf-8")
std::istream * input_stream()
std::ostream * output_stream()
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
float_format native_float_format()