26 #if ! defined (octave_oct_strstrm_h)
27 #define octave_oct_strstrm_h 1
29 #include "octave-config.h"
44 const std::string& encoding =
"utf-8")
45 :
octave::base_stream (
m, ff, encoding) { }
61 int seek (off_t,
int);
65 virtual off_t tell (
void);
69 std::string
name (
void)
const {
return ""; }
71 virtual std::streambuf *
rdbuf (
void) = 0;
73 virtual bool bad (
void)
const = 0;
84 std::ios::openmode arg_md = std::ios::out,
87 const std::string& encoding =
"utf-8")
91 std::ios::openmode arg_md = std::ios::out,
94 const std::string& encoding =
"utf-8")
111 create (
const char *data, std::ios::openmode arg_md = std::ios::out,
114 const std::string& encoding =
"utf-8");
117 create (
const std::string& data, std::ios::openmode arg_md = std::ios::out,
120 const std::string& encoding =
"utf-8");
124 bool eof (
void)
const {
return m_istream.eof (); }
130 off_t
tell (
void) {
return m_istream.tellg (); }
134 return m_istream ? m_istream.rdbuf () :
nullptr;
137 bool bad (
void)
const {
return m_istream.bad (); }
139 void clear (
void) { m_istream.clear (); }
154 const std::string& encoding =
"utf-8")
170 create (std::ios::openmode arg_md = std::ios::out,
173 const std::string& encoding =
"utf-8");
177 bool eof (
void)
const {
return m_ostream.eof (); }
183 std::string
str (
void) {
return m_ostream.str (); }
187 return m_ostream ? m_ostream.rdbuf () :
nullptr;
190 bool bad (
void)
const {
return m_ostream.bad (); }
192 void clear (
void) { m_ostream.clear (); }
~octave_base_strstream(void)=default
virtual bool bad(void) const =0
virtual std::streambuf * rdbuf(void)=0
virtual void clear(void)=0
octave_base_strstream(std::ios::openmode m=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
octave_base_strstream(const octave_base_strstream &)=delete
std::string name(void) const
octave_istrstream(const char *data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
std::ostream * output_stream(void)
octave_istrstream(const std::string &data, std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
std::streambuf * rdbuf(void)
octave_istrstream(const octave_istrstream &)=delete
~octave_istrstream(void)=default
std::istringstream m_istream
std::istream * input_stream(void)
std::ostringstream m_ostream
~octave_ostrstream(void)=default
octave_ostrstream(const octave_ostrstream &)=delete
octave_ostrstream(std::ios::openmode arg_md=std::ios::out, octave::mach_info::float_format ff=octave::mach_info::native_float_format(), const std::string &encoding="utf-8")
std::streambuf * rdbuf(void)
std::istream * input_stream(void)
std::ostream * output_stream(void)
float_format native_float_format(void)