|
Swiftray
1.0
|
Save and load documents as binary format. More...
#include <document-serializer.h>
Public Member Functions | |
| DocumentSerializer (QDataStream &stream) | |
| BitmapShape * | deserializeBitmapShape () |
| Document * | deserializeDocument () |
| GroupShape * | deserializeGroupShape () |
| LayerPtr | deserializeLayer () |
| PathShape * | deserializePathShape () |
| ShapePtr | deserializeShape () |
| void | deserializeShapeProp (Shape *shape) |
| TextShape * | deserializeTextShape () |
| void | serializeBitmapShape (BitmapShape *shape) |
| void | serializeDocument (Document &doc) |
| void | serializeGroupShape (GroupShape *shape) |
| void | serializeLayer (const LayerPtr &layer) |
| void | serializePathShape (PathShape *shape) |
| void | serializeShape (const ShapePtr &shape) |
| void | serializeShapeProp (Shape *shape) |
| void | serializeTextShape (TextShape *shape) |
Public Attributes | |
| QDataStream & | in |
| QDataStream & | out |
Save and load documents as binary format.
We use a single file for the serializer to maintain different file versions, so if we add new properties to the document/layer/shape objects in new versions, we can extend the serializer instead of adding a lot if/else to different classes. Notes: We can also use JSON, which is easier for backward-compatiblity and debug, but the performance may be slow. Notes: We may also use JSON partially to support volatile classes. JSON (O): Document settings, memo, metadata JSON (X): QPainterShape, QPixmap TODO (Add JSON Serializer for debugging scenes)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| QDataStream& DocumentSerializer::in |
| QDataStream& DocumentSerializer::out |