Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
Inkscape::IO::InputStream Class Referenceabstract

This interface is the base of all input stream classes. More...

#include <inkscapestream.h>

Inheritance diagram for Inkscape::IO::InputStream:
Inkscape::IO::BasicInputStream Inkscape::IO::BufferInputStream Inkscape::IO::FileInputStream Inkscape::IO::StdInputStream Inkscape::IO::StringInputStream Inkscape::IO::GzipInputStream Inkscape::IO::XsltInputStream

Public Member Functions

 InputStream ()=default
 Constructor.
 
virtual ~InputStream ()=default
 Destructor.
 
virtual int available ()=0
 Return the number of bytes that are currently available to be read.
 
virtual void close ()=0
 Do whatever it takes to 'close' this input stream The most likely implementation of this method will be for endpoints that use a resource for their data.
 
virtual int get ()=0
 Read one byte from this input stream.
 

Detailed Description

This interface is the base of all input stream classes.

Users who wish to make an InputStream that is part of a chain should inherit from BasicInputStream. Inherit from this class to make a source endpoint, such as a URI or buffer.

Definition at line 52 of file inkscapestream.h.

Constructor & Destructor Documentation

◆ InputStream()

Inkscape::IO::InputStream::InputStream ( )
default

Constructor.

◆ ~InputStream()

virtual Inkscape::IO::InputStream::~InputStream ( )
virtualdefault

Destructor.

Member Function Documentation

◆ available()

◆ close()

virtual void Inkscape::IO::InputStream::close ( )
pure virtual

Do whatever it takes to 'close' this input stream The most likely implementation of this method will be for endpoints that use a resource for their data.

Implemented in Inkscape::IO::BufferInputStream, Inkscape::IO::GzipInputStream, Inkscape::IO::BasicInputStream, Inkscape::IO::StdInputStream, Inkscape::IO::StringInputStream, Inkscape::IO::FileInputStream, and Inkscape::IO::XsltInputStream.

Referenced by Inkscape::IO::BasicInputStream::close(), Inkscape::IO::InputStreamReader::close(), and Inkscape::IO::StdReader::close().

◆ get()

virtual int Inkscape::IO::InputStream::get ( )
pure virtual

Read one byte from this input stream.

This is a blocking call. If no data is currently available, this call will not return until it exists. If the user does not want their code to block, then the usual solution is: if (available() > 0) myChar = get(); This call returns -1 on end-of-file.

Implemented in Inkscape::IO::BufferInputStream, Inkscape::IO::GzipInputStream, Inkscape::IO::BasicInputStream, Inkscape::IO::StdInputStream, Inkscape::IO::StringInputStream, Inkscape::IO::FileInputStream, and Inkscape::IO::XsltInputStream.

Referenced by Inkscape::IO::BasicInputStream::get(), Inkscape::IO::InputStreamReader::get(), Inkscape::IO::StdReader::get(), Inkscape::IO::GzipInputStream::load(), and Inkscape::IO::pipeStream().


The documentation for this class was generated from the following file: