Workspace 6.21.5
Public Member Functions | List of all members
SerializedTreeJsonIO Class Reference

Interface for writing out a serialized tree in an JSON format.

#include <Workspace/DataExecution/Serialization/serializedtreejsonio.h>

Inheritance diagram for SerializedTreeJsonIO:
[legend]

Public Member Functions

 SerializedTreeJsonIO ()
 
bool loadFile (SerializedTree &tree, const QString &fileName) override
 
bool loadString (SerializedTree &tree, const QString &contents) override
 
bool saveFile (const SerializedTree &tree, const QString &fileName) const override
 
QString subtreeToString (const SerializedItem &element) const override
 
QString treeToString (const SerializedTree &tree) const override
 
virtual bool loadFile (SerializedTree &tree, const QString &fileName)=0
 
virtual bool loadString (SerializedTree &tree, const QString &contents)=0
 
virtual bool saveFile (const SerializedTree &tree, const QString &fileName) const =0
 
virtual QString subtreeToString (const SerializedItem &item) const =0
 
virtual QString treeToString (const SerializedTree &tree) const =0
 

Constructor & Destructor Documentation

◆ SerializedTreeJsonIO()

Member Function Documentation

◆ loadFile()

bool loadFile ( SerializedTree tree,
const QString &  fileName 
)
overridevirtual
Parameters
treeThe tree to load.
fileNameThe name of the file to read from containing JSON data.
Returns
true if the file was able to be loaded successfully, false otherwise.

Loads a SerializedTree from a file

Implements SerializedTreeIO.

◆ loadString()

bool loadString ( SerializedTree tree,
const QString &  contents 
)
overridevirtual
Parameters
treeThe tree to load.
contentsJSON content to load into the tree.
Returns
true if the file was able to be loaded successfully, false otherwise.

Loads a SerializedTree from a string.

Implements SerializedTreeIO.

◆ saveFile()

bool saveFile ( const SerializedTree tree,
const QString &  fileName 
) const
overridevirtual
Parameters
treeThe tree to save.
fileNameThe name of the file to write to.
Returns
true if the save was successful, false if errors were encountered.

Saves a SerializedTree to file in an JSON format.

Implements SerializedTreeIO.

◆ subtreeToString()

QString subtreeToString ( const SerializedItem element) const
overridevirtual
Parameters
elementThe element representing the sub-tree to serialize to a string.
Returns
An JSON string representation of the subtree.

Serializes the sub-tree represented by element to a QString in an JSON format.

Implements SerializedTreeIO.

◆ treeToString()

QString treeToString ( const SerializedTree tree) const
overridevirtual
Parameters
treeThe tree to serialize to a string.
Returns
A JSON string representation of the tree.

Serializes the tree to a QString in a JSON format.

Implements SerializedTreeIO.