#include <Serialiser.h>
|
| | Serialiser (File serialiserFile) |
| |
| void | addAction (std::unique_ptr< Action > action) |
| | Add an action object to the serialiser which will be executed. Create your own subclass of Action overriding execute() to create your action. Run the actions using executeActions().
|
| |
| void | executeActions () |
| | Execute the serialiser. This will parse actions from the serialiser file, executing all added actions that don't exist or are not marked as done. When completed, the file is updated with the action execution result and info.
|
| |
| bool | isActionDone (String actionName) |
| | Returns true if the action has been executed.
|
| |
|
| void | createActionQueue () |
| |
| void | writeActionData () |
| |
| | JsonFile (File jsonFile, const Identifier &defaultProperty, const String &defaultFormat) |
| | Simple helper class for handling json files. It will attempt to create a json file with the given default property and format, or if the given json file already exists, it will attempt to parse it and check it has the default property.
|
| |
| var | getDefaultProperty () const |
| | Get the variant for the default property.
|
| |
| const String & | getDefaultFormat () const |
| | Gets the underlying default formatted json, this is used as a fallback when an invalid input is passed to the JSON file.
|
| |
| void | initialise () |
| | Parse the file if it exists, or create it if it doesn't. Data is parsed to m_data;.
|
| |
| void | save () |
| | Call save internal.
|
| |
| void | createJsonFromDefaultFormat () |
| | Generate the JSON file using the default format - used in cases where JSON fails to load.
|
| |
◆ PSTags
◆ Serialiser()
| krotos::Serialiser::Serialiser |
( |
File | serialiserFile | ) |
|
◆ addAction()
| void krotos::Serialiser::addAction |
( |
std::unique_ptr< Action > | action | ) |
|
Add an action object to the serialiser which will be executed. Create your own subclass of Action overriding execute() to create your action. Run the actions using executeActions().
◆ createActionQueue()
| void krotos::Serialiser::createActionQueue |
( |
| ) |
|
|
private |
◆ executeActions()
| void krotos::Serialiser::executeActions |
( |
| ) |
|
Execute the serialiser. This will parse actions from the serialiser file, executing all added actions that don't exist or are not marked as done. When completed, the file is updated with the action execution result and info.
◆ isActionDone()
| bool krotos::Serialiser::isActionDone |
( |
String | actionName | ) |
|
Returns true if the action has been executed.
- Parameters
-
| actionName | The name of the action to lookup. |
◆ writeActionData()
| void krotos::Serialiser::writeActionData |
( |
| ) |
|
|
private |
◆ DEFAULT_FORMAT
| const String krotos::Serialiser::DEFAULT_FORMAT |
|
staticprivate |
Initial value:{"{"
"\"serialiser_version\": \"1\","
"\"actions\" : []}"}
◆ m_actionMap
| std::map<String, std::unique_ptr<Action> > krotos::Serialiser::m_actionMap |
|
private |
◆ m_actionQueue
| std::vector<Action*> krotos::Serialiser::m_actionQueue |
|
private |
◆ m_executedActions
| std::vector<Action*> krotos::Serialiser::m_executedActions |
|
private |
The documentation for this class was generated from the following files: