TGUI  0.7.8
tgui::WidgetSaver Class Reference

Class to save widgets to a text file. More...

#include <TGUI/Loading/WidgetSaver.hpp>

Static Public Member Functions

static void save (Container::Ptr widget, std::stringstream &stream)
 Save a container and its child widgets to a stream. More...
 
static void setSaveFunction (const std::string &type, const SaveFunction &saveFunction)
 Change the save function for a certain widget type. More...
 
static const SaveFunction & getSaveFunction (const std::string &type)
 Retrieve the save function of a certain widget type. More...
 

Detailed Description

Class to save widgets to a text file.

Member Function Documentation

◆ getSaveFunction()

static const SaveFunction & tgui::WidgetSaver::getSaveFunction ( const std::string &  type)
static

Retrieve the save function of a certain widget type.

Parameters
typeType of the widget
Returns
Function called to save the widget

◆ save()

static void tgui::WidgetSaver::save ( Container::Ptr  widget,
std::stringstream &  stream 
)
static

Save a container and its child widgets to a stream.

Parameters
widgetThe container to save
streamStream to which the widget file will be written to
Note
You should use the saveWidgetsToFile or saveWidgetsToSteam functions in Gui and Container instead of calling this function directly.

◆ setSaveFunction()

static void tgui::WidgetSaver::setSaveFunction ( const std::string &  type,
const SaveFunction &  saveFunction 
)
static

Change the save function for a certain widget type.

Parameters
typeType of the widget
saveFunctionNew save function

The documentation for this class was generated from the following file: