TGUI
0.9.5
|
Default implementation for theme loading. More...
#include <TGUI/Loading/ThemeLoader.hpp>
Public Member Functions | |
void | preload (const String &filename) override |
Loads the theme file in cache. | |
const std::map< String, String > & | load (const String &filename, const String §ion) override |
Loads the property-value pairs from the theme file. | |
bool | canLoad (const String &filename, const String §ion) override |
Check if the requested property-value pairs are available. | |
Public Member Functions inherited from tgui::BaseThemeLoader | |
virtual | ~BaseThemeLoader ()=default |
Virtual destructor. | |
Static Public Member Functions | |
static void | flushCache (const String &filename="") |
Empties the caches and force files to be reloaded. | |
Protected Member Functions | |
virtual std::unique_ptr< DataIO::Node > | readFile (const String &filename) const |
Reads and return the contents of the entire file. | |
Protected Member Functions inherited from tgui::BaseThemeLoader | |
void | injectThemePath (const std::unique_ptr< DataIO::Node > &node, const String &path) const |
void | resolveReferences (std::map< String, std::reference_wrapper< const std::unique_ptr< DataIO::Node > > > §ions, const std::unique_ptr< DataIO::Node > &node) const |
Static Protected Attributes | |
static std::map< String, std::map< String, std::map< String, String > > > | m_propertiesCache |
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.
|
overridevirtual |
Check if the requested property-value pairs are available.
filename | Filename of the theme file |
section | Name of the section inside the theme file |
Implements tgui::BaseThemeLoader.
|
static |
Empties 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 |
Loads the property-value pairs from the theme file.
filename | Filename of the theme file |
section | Name of the section inside the theme file |
Exception | when finding syntax errors in the file |
Exception | when file did not contain requested class name |
Implements tgui::BaseThemeLoader.
|
overridevirtual |
Loads the theme file in cache.
filename | Filename of the theme file to load |
Exception | when finding syntax errors in the file |
Reimplemented from tgui::BaseThemeLoader.
|
protectedvirtual |
Reads and return the contents of the entire file.
filename | Filename of the file to read |