Belle II Software development
|
Define (de)serialization methods for TObject. More...
Functions | |
std::string | serializeAndEncode (const TObject *obj) |
Convert given TObject into encoded byte stream (for storing in XML). | |
std::string | escapeXML (const std::string &xmlString) |
Escape given XML string as CDATA sequence. | |
TObject * | deserializeEncodedRawData (const std::string &base64Data) |
Convert given serialized raw data back into TObject. | |
Define (de)serialization methods for TObject.
This code is also exported to Python, after 'from ROOT import Belle2' it is available as Belle2.Stream.
TObject * deserializeEncodedRawData | ( | const std::string & | base64Data | ) |
Convert given serialized raw data back into TObject.
Returns a pointer to the deserialized object, might be NULL if conversion was impossible. User is responsible for deletion.
If input is not well-formed base64-encoded data, this might crash.
Definition at line 72 of file Stream.cc.
std::string escapeXML | ( | const std::string & | xmlString | ) |
Escape given XML string as CDATA sequence.
This format is suitable for storing in an XML file, wrap it in a tag and use Gearbox::getInstance().getTObject(".../MyTag") to retrieve the object again.
Definition at line 64 of file Stream.cc.
std::string serializeAndEncode | ( | const TObject * | obj | ) |
Convert given TObject into encoded byte stream (for storing in XML).
Returns base64-encoded TMessage. Please pass it through escapeXML() first.
Definition at line 32 of file Stream.cc.