Belle II Software light-2406-ragdoll
StringContext Class Reference

InputContext which just returns the value of a string previously assigned. More...

#include <StringHandler.h>

Inheritance diagram for StringContext:
Collaboration diagram for StringContext:

Public Member Functions

 StringContext (const std::string &data)
 Take an XML fragment as parameter and create a context for it.
 
virtual int readXmlData (char *buffer, int buffsize) override
 Return a block of the data.
 

Protected Attributes

std::istringstream m_stream
 Assigned data string.
 

Detailed Description

InputContext which just returns the value of a string previously assigned.

Definition at line 21 of file StringHandler.h.

Constructor & Destructor Documentation

◆ StringContext()

StringContext ( const std::string &  data)
inlineexplicit

Take an XML fragment as parameter and create a context for it.

Definition at line 24 of file StringHandler.h.

24: m_stream(data) {};
std::istringstream m_stream
Assigned data string.
Definition: StringHandler.h:33

Member Function Documentation

◆ readXmlData()

virtual int readXmlData ( char *  buffer,
int  buffsize 
)
inlineoverridevirtual

Return a block of the data.

Implements InputContext.

Definition at line 26 of file StringHandler.h.

27 {
28 m_stream.read(buffer, buffsize);
29 return m_stream.gcount();
30 }

Member Data Documentation

◆ m_stream

std::istringstream m_stream
protected

Assigned data string.

Definition at line 33 of file StringHandler.h.


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