MeVisLab Toolbox Reference
|
AbstactPersistenceStream is the base class for AbstractPersistenceOutputStream and AbstractPersistenceInputStream, and implements the methods that are common for both these classes. More...
#include <mlAbstractPersistenceStream.h>
Public Member Functions | |
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... | |
Protected Member Functions | |
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.
|
protected |
|
protectedvirtual |
void ml::AbstractPersistenceStream::endList | ( | ) |
Ends reading/writing of the list.
|
protectedpure virtual |
Implemented in ml::XMLPersistenceInputStream, and ml::XMLPersistenceOutputStream.
void ml::AbstractPersistenceStream::endStruct | ( | ) |
Ends reading/writing of struct values.
|
protectedpure virtual |
Implemented in ml::XMLPersistenceInputStream, and ml::XMLPersistenceOutputStream.
|
protectedvirtual |
Logs an internal error. Usually called to indicate wrong usage of interface.
|
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.
Implemented in ml::XMLPersistenceInputStream, and ml::XMLPersistenceOutputStream.
|
inlineprotected |
Checks whether the stream is currently in 'list' mode. Otherwise, it is in 'struct' mode.
Definition at line 96 of file mlAbstractPersistenceStream.h.
|
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.
|
inlineprotected |
Returns depth of nesting stack (created by startList/startStruct), used to check nesting rules.
Definition at line 99 of file mlAbstractPersistenceStream.h.
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.
|
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.
Implemented in ml::XMLPersistenceInputStream, and ml::XMLPersistenceOutputStream.
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.
|
protectedpure virtual |
Implemented in ml::XMLPersistenceInputStream, and ml::XMLPersistenceOutputStream.