2#ifndef SEEN_INKSCAPE_IO_INKSCAPESTREAM_H
3#define SEEN_INKSCAPE_IO_INKSCAPESTREAM_H
14#include <glibmm/ustring.h>
29 :
reason(std::move(theReason))
33 char const *
what() const noexcept
override
89 virtual int get() = 0;
112 void close()
override;
143 {
return getchar(); }
195 virtual int put(
char ch) = 0;
214 void close()
override;
216 void flush()
override;
218 int put(
char ch)
override;
245 {
return putchar(ch); }
334 void close()
override;
406 void close()
override;
433 void close()
override;
476 virtual void put(
char ch) = 0;
526 void close()
override;
528 void flush()
override;
530 void put(
char ch)
override;
569 { destination =
nullptr; }
617 void close()
override;
619 void flush()
override;
621 void put(
char ch)
override;
643 void close()
override;
646 void flush()
override;
649 void put(
char ch)
override;
This is the class that most users should inherit, to provide their own output streams.
OutputStream & destination
void flush() override
Flushes this output stream and forces any buffered output bytes to be written out.
~BasicOutputStream() override=default
void close() override
Closes this output stream and releases any system resources associated with this stream.
int put(char ch) override
Writes the specified byte to this output stream.
This class and its descendants are for unicode character-oriented input.
const Reader & readBool(bool &val) override
const Reader & operator>>(bool &val) override
const Reader & readShort(short &val) override
int available() override
Returns the number of bytes that can be read (or skipped over) from this reader without blocking by t...
const Reader & readLong(long &val) override
const Reader & readUnsignedInt(unsigned int &val) override
const Reader & readFloat(float &val) override
const Reader & readInt(int &val) override
~BasicReader() override=default
const Reader & readUnsignedLong(unsigned long &val) override
const Reader & readUnsignedShort(unsigned short &val) override
const Reader & readDouble(double &val) override
void close() override
Closes this reader and releases any system resources associated with the reader.
char get() override
Reads the next byte of data from the reader.
Glib::ustring readLine() override
Reads a line of data from the reader.
Glib::ustring readWord() override
Reads a line of data from the reader.
This class and its descendants are for unicode character-oriented output.
~BasicWriter() override=default
Class for placing a Writer on an open OutputStream.
OutputStream & outputStream
This interface is the base of all input stream classes.
virtual int put(char ch)=0
Send one byte to the destination stream.
OutputStream()=default
Constructor.
virtual void close()=0
This call should.
virtual ~OutputStream()=default
Destructor.
virtual void flush()=0
This call should push any pending data it might have to the destination stream.
This interface and its descendants are for unicode character-oriented input.
virtual int available()=0
virtual const Reader & readUnsignedLong(unsigned long &val)=0
virtual const Reader & readUnsignedShort(unsigned short &val)=0
Reader()=default
Constructor.
virtual Glib::ustring readWord()=0
virtual const Reader & readFloat(float &val)=0
virtual const Reader & readDouble(double &val)=0
virtual const Reader & readShort(short &val)=0
virtual ~Reader()=default
Destructor.
virtual const Reader & readInt(int &val)=0
virtual const Reader & operator>>(bool &val)=0
virtual Glib::ustring readLine()=0
virtual const Reader & readBool(bool &val)=0
virtual const Reader & readUnsignedInt(unsigned int &val)=0
virtual const Reader & readLong(long &val)=0
Convenience class for writing to standard output.
int put(char ch) override
Send one byte to the destination stream.
void flush() override
This call should push any pending data it might have to the destination stream.
void close() override
This call should.
Convenience class for reading formatted from standard input.
int available() override
Flush the underlying OutputStream.
char get() override
Overloaded to receive its bytes from an InputStream rather than a Reader.
void close() override
Close the underlying OutputStream.
InputStream * inputStream
Convenience class for writing to standard output.
OutputStream * outputStream
char const * what() const noexcept override
StreamException(Glib::ustring theReason) noexcept
~StreamException() noexcept override=default
This interface and its descendants are for unicode character-oriented output.
virtual Writer & writeDouble(double val)=0
virtual Writer & writeInt(int val)=0
virtual Writer & writeBool(bool val)=0
virtual Writer & printf(char const *fmt,...) G_GNUC_PRINTF(2
virtual Writer & writeUnsignedLong(unsigned long val)=0
virtual Writer & writeLong(long val)=0
virtual Writer & writeShort(short val)=0
virtual Writer & writeString(const char *str)=0
virtual Writer & writeUnsignedShort(unsigned short val)=0
virtual Writer & writeStdString(const std::string &val)=0
virtual Writer virtual Writer & writeChar(char val)=0
virtual Writer & writeUString(const Glib::ustring &val)=0
virtual ~Writer()=default
Destructor.
Writer()=default
Constructor.
virtual Writer & writeFloat(float val)=0
virtual void put(char ch)=0
virtual Writer & writeUnsignedInt(unsigned int val)=0
void pipeStream(InputStream &source, OutputStream &dest)
Helper class to stream background task notifications as a series of messages.
int G_GNUC_PRINTF(2, 3) safeprintf(char(&buf)[N]