26#ifndef TGUI_THEME_LOADER_HPP
27#define TGUI_THEME_LOADER_HPP
30#include <TGUI/String.hpp>
31#include <TGUI/Loading/DataIO.hpp>
73 virtual const std::map<String, String>&
load(
const String& primary,
const String& secondary) = 0;
96 void injectThemePath(
const std::unique_ptr<DataIO::Node>& node,
const String& path)
const;
102 void resolveReferences(std::map<
String, std::reference_wrapper<
const std::unique_ptr<DataIO::Node>>>& sections,
const std::unique_ptr<DataIO::Node>& node)
const;
142 const std::map<String, String>&
load(
const String& filename,
const String& section)
override;
180 static std::map<String, std::map<String, std::map<String, String>>> m_propertiesCache;
Base class for theme loader implementations.
Definition ThemeLoader.hpp:46
virtual bool canLoad(const String &primary, const String &secondary)=0
Check if the requested property-value pairs are available.
virtual void preload(const String &primary)
Optionally already do some work when only the primary parameter is known yet.
virtual const std::map< String, String > & load(const String &primary, const String &secondary)=0
Loads the property-value pairs from the theme.
virtual ~BaseThemeLoader()=default
Virtual destructor.
Default implementation for theme loading.
Definition ThemeLoader.hpp:118
static void flushCache(const String &filename="")
Empties the caches and force files to be reloaded.
bool canLoad(const String &filename, const String §ion) override
Check if the requested property-value pairs are available.
const std::map< String, String > & load(const String &filename, const String §ion) override
Loads the property-value pairs from the theme file.
virtual std::unique_ptr< DataIO::Node > readFile(const String &filename) const
Reads and return the contents of the entire file.
void preload(const String &filename) override
Loads the theme file in cache.
Wrapper class to store strings.
Definition String.hpp:79
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36