AbstactPersistenceStream is the base class for AbstractPersistenceOutputStream and AbstractPersistenceInputStream, and implements the methods that are common for both these classes.
More...
#include <mlAbstractPersistenceStream.h>
|
void | startList (const char *name=nullptr, const char *xmlItemName="Item", bool xmlSuppressScope=false) |
| Starts a new list of values in the data stream, must be ended with endList(). More...
|
|
void | endList () |
| Ends reading/writing of the list. More...
|
|
void | startStruct (const char *name=nullptr) |
| Starts a new struct of values in the data stream, must be ended with endStruct(). More...
|
|
void | endStruct () |
| Ends reading/writing of struct values. More...
|
|
virtual bool | isBinary () const =0 |
| Is the stream in a binary format? Otherwise, it is in a human-readable text format. More...
|
|
|
| AbstractPersistenceStream () |
|
virtual | ~AbstractPersistenceStream () |
|
virtual void | nameCheck (const char *name) |
| Checks whether the name is provided when being in a subgroup, or that no name is provided when being in a list. More...
|
|
bool | isInList () const |
| Checks whether the stream is currently in 'list' mode. Otherwise, it is in 'struct' mode. More...
|
|
size_t | nestingDepth () const |
| Returns depth of nesting stack (created by startList/startStruct), used to check nesting rules. More...
|
|
virtual void | internalError (const char *msg, const char *arg=nullptr) |
| Logs an internal error. Usually called to indicate wrong usage of interface. More...
|
|
|
virtual void | startListImpl (const char *name, const char *xmlItemName, bool xmlSuppressScope)=0 |
| Abstract methods called by above methods, needs to be implemented in derived classes. More...
|
|
virtual void | endListImpl ()=0 |
|
virtual void | startStructImpl (const char *name)=0 |
|
virtual void | endStructImpl ()=0 |
|
AbstactPersistenceStream is the base class for AbstractPersistenceOutputStream and AbstractPersistenceInputStream, and implements the methods that are common for both these classes.
Definition at line 49 of file mlAbstractPersistenceStream.h.
◆ AbstractPersistenceStream()
ml::AbstractPersistenceStream::AbstractPersistenceStream |
( |
| ) |
|
|
protected |
◆ ~AbstractPersistenceStream()
virtual ml::AbstractPersistenceStream::~AbstractPersistenceStream |
( |
| ) |
|
|
protectedvirtual |
◆ endList()
void ml::AbstractPersistenceStream::endList |
( |
| ) |
|
Ends reading/writing of the list.
◆ endListImpl()
virtual void ml::AbstractPersistenceStream::endListImpl |
( |
| ) |
|
|
protectedpure virtual |
◆ endStruct()
void ml::AbstractPersistenceStream::endStruct |
( |
| ) |
|
Ends reading/writing of struct values.
◆ endStructImpl()
virtual void ml::AbstractPersistenceStream::endStructImpl |
( |
| ) |
|
|
protectedpure virtual |
◆ internalError()
virtual void ml::AbstractPersistenceStream::internalError |
( |
const char * |
msg, |
|
|
const char * |
arg = nullptr |
|
) |
| |
|
protectedvirtual |
Logs an internal error. Usually called to indicate wrong usage of interface.
◆ isBinary()
virtual bool ml::AbstractPersistenceStream::isBinary |
( |
| ) |
const |
|
pure virtual |
Is the stream in a binary format? Otherwise, it is in a human-readable text format.
Users might adapt the persistence depending on this value.
◆ isInList()
bool ml::AbstractPersistenceStream::isInList |
( |
| ) |
const |
|
inlineprotected |
◆ nameCheck()
virtual void ml::AbstractPersistenceStream::nameCheck |
( |
const char * |
name | ) |
|
|
protectedvirtual |
Checks whether the name is provided when being in a subgroup, or that no name is provided when being in a list.
Otherwise, an error is logged.
Reimplemented in ml::AbstractPersistenceOutputStream.
◆ nestingDepth()
size_t ml::AbstractPersistenceStream::nestingDepth |
( |
| ) |
const |
|
inlineprotected |
Returns depth of nesting stack (created by startList/startStruct), used to check nesting rules.
Definition at line 99 of file mlAbstractPersistenceStream.h.
◆ startList()
void ml::AbstractPersistenceStream::startList |
( |
const char * |
name = nullptr , |
|
|
const char * |
xmlItemName = "Item" , |
|
|
bool |
xmlSuppressScope = false |
|
) |
| |
Starts a new list of values in the data stream, must be ended with endList().
Subsequent read or write calls are not allowed to provide a name for items. Listed items should all be of the same type.
For legacy reasons (old XML persistence interface), one can specify the name for list items and whether the list should not start a separate scope. The list simply consists of items of the same name then. You still need to specify an object name for other formats.
◆ startListImpl()
virtual void ml::AbstractPersistenceStream::startListImpl |
( |
const char * |
name, |
|
|
const char * |
xmlItemName, |
|
|
bool |
xmlSuppressScope |
|
) |
| |
|
protectedpure virtual |
Abstract methods called by above methods, needs to be implemented in derived classes.
Implementors do not need to perform error checking.
xmlItemName and xmlSuppressScope only need to be regarded for XML format.
◆ startStruct()
void ml::AbstractPersistenceStream::startStruct |
( |
const char * |
name = nullptr | ) |
|
Starts a new struct of values in the data stream, must be ended with endStruct().
Subsequent read or write calls need to provide a name for the different values.
◆ startStructImpl()
virtual void ml::AbstractPersistenceStream::startStructImpl |
( |
const char * |
name | ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file: