TGUI
0.7.8
|
Default implementation for theme loading. More...
#include <TGUI/Loading/ThemeLoader.hpp>
Public Member Functions | |
std::string | load (const std::string &filename, const std::string &className, PropertyValuePairs &properties) override |
Load the property-value pairs from the theme file. More... | |
![]() | |
virtual | ~BaseThemeLoader ()=default |
Virtual destructor. | |
Static Public Member Functions | |
static void | flushCache (const std::string &filename="") |
Empty the caches and force files to be reloaded. More... | |
Protected Member Functions | |
virtual void | readFile (const std::string &filename, std::stringstream &contents) const |
Reads and return the contents of the entire file. More... | |
Default implementation for theme loading.
Themes are stored on disk in files which contain sections with a syntax similar to CSS. This loader will be able to extract the data from these files.
On first access, the entire file will be cached, the next times the cached map is simply returned.
|
static |
Empty the caches and force files to be reloaded.
filename | File to remove from cache. If no filename is given, the entire cache is cleared. |
|
overridevirtual |
Load the property-value pairs from the theme file.
filename | Filename of the theme file |
className | Name of the class inside the theme file (equals widget type when no class is given) |
properties | Empty map op property-value pairs that will be filled by this function |
Exception | when finding syntax errors in the file |
Exception | when file did not contain requested class name |
Implements tgui::BaseThemeLoader.
|
protectedvirtual |
Reads and return the contents of the entire file.
filename | Filename of the file to read |
contents | Reference to a stringstream that should be filled with the contents of the file by this function |