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) |
Start a new list of values in the data stream, must be ended with endList(). | |
void | endList () |
End reading/writing of the list. | |
void | startStruct (const char *name=nullptr) |
Start a new struct of values in the data stream, must be ended with endStruct(). | |
void | endStruct () |
End reading/writing of struct values. | |
virtual bool | isBinary () const =0 |
Is the stream in a binary format? (otherwise in a readable text format) | |
Protected Member Functions | |
AbstractPersistenceStream () | |
virtual | ~AbstractPersistenceStream () |
virtual void | nameCheck (const char *name) |
Check if the name is provided when being in a sub-group, or that no name is provided when being in a list. | |
bool | isInList () const |
Check if the stream is currently in "list" mode. Otherwise it is in "struct" mode. | |
size_t | nestingDepth () const |
return depth of nesting stack (created by startList/startStruct), used to check nesting rules | |
virtual void | internalError (const char *msg, const char *arg=nullptr) |
Log an internal error. Usually called to indicate wrong usage of interface. | |
virtual void | startListImpl (const char *name, const char *xmlItemName, bool xmlSuppressScope)=0 |
Abstract methods called by above methods, need to be implemented in derived classes. | |
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 | ( | ) |
End reading/writing of the list.
Implemented in ml::XMLPersistenceOutputStream, and ml::XMLPersistenceInputStream.
void ml::AbstractPersistenceStream::endStruct | ( | ) |
End reading/writing of struct values.
Implemented in ml::XMLPersistenceOutputStream, and ml::XMLPersistenceInputStream.
|
protectedvirtual |
Log an internal error. Usually called to indicate wrong usage of interface.
Is the stream in a binary format? (otherwise in a readable text format)
Users might adapt the persistence depending on this value.
Implemented in ml::XMLPersistenceOutputStream, and ml::XMLPersistenceInputStream.
|
inlineprotected |
Check if the stream is currently in "list" mode. Otherwise it is in "struct" mode.
Definition at line 96 of file mlAbstractPersistenceStream.h.
Check if the name is provided when being in a sub-group, or that no name is provided when being in a list.
Otherwise an error is logged.
Reimplemented in ml::AbstractPersistenceOutputStream.
|
inlineprotected |
return 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 ) |
Start 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. List 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 a object name for other formats.)
|
protectedpure virtual |
Abstract methods called by above methods, need to be implemented in derived classes.
Implementors don't need to do error checking.
xmlItemName and xmlSuppressScope only need to be regarded for XML format:
Implemented in ml::XMLPersistenceOutputStream, and ml::XMLPersistenceInputStream.
Start 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::XMLPersistenceOutputStream, and ml::XMLPersistenceInputStream.