PLaSK library
Loading...
Searching...
No Matches
plask::XMLReader::StreamDataSource Struct Reference

Allows to read XML from standard C++ input stream (std::istream). More...

#include <plask/utils/xml/reader.hpp>

Inheritance diagram for plask::XMLReader::StreamDataSource:
[legend]
Collaboration diagram for plask::XMLReader::StreamDataSource:
[legend]

Public Member Functions

template<typename... Args>
 StreamDataSource (Args &&... params)
 
std::size_t read (char *buff, std::size_t buf_size) override
 Read buf_size bytes of data and store it in buffer buff.
 
- Public Member Functions inherited from plask::XMLReader::DataSource
virtual ~DataSource ()
 Empty, virtual destructor.
 

Public Attributes

std::unique_ptr< std::istream > input
 Stream to read from.
 

Detailed Description

Allows to read XML from standard C++ input stream (std::istream).

Definition at line 150 of file reader.hpp.

Constructor & Destructor Documentation

◆ StreamDataSource()

template<typename... Args>
plask::XMLReader::StreamDataSource::StreamDataSource ( Args &&...  params)
inline
Parameters
paramsarguments for std::unique_ptr<std::istream> constructor

Definition at line 159 of file reader.hpp.

Member Function Documentation

◆ read()

std::size_t plask::XMLReader::StreamDataSource::read ( char buff,
std::size_t  buf_size 
)
overridevirtual

Read buf_size bytes of data and store it in buffer buff.

Throws exception if can't read.

Parameters
buffdestination buffer
buf_sizesize of buff
Returns
number of bytes read, less than buf_size only at the end of data

Implements plask::XMLReader::DataSource.

Definition at line 23 of file reader.cpp.

Member Data Documentation

◆ input

std::unique_ptr<std::istream> plask::XMLReader::StreamDataSource::input

Stream to read from.

Definition at line 153 of file reader.hpp.


The documentation for this struct was generated from the following files: