TGUI
0.10-beta
|
Implicit converter for settable properties. More...
#include <TGUI/ObjectConverter.hpp>
Public Types | |
enum class | Type { None , Bool , Font , Color , String , Number , Outline , Texture , TextStyle , RendererData } |
Public Member Functions | |
ObjectConverter () | |
Default constructor, to create an empty object. | |
ObjectConverter (const char *string) | |
Stores a string for later retrieval. More... | |
ObjectConverter (const String &string) | |
Stores a string for later retrieval. More... | |
ObjectConverter (Font font) | |
Stores a font object for later retrieval. More... | |
ObjectConverter (Color color) | |
Stores a color object for later retrieval. More... | |
ObjectConverter (bool value) | |
Stores a boolean for later retrieval. More... | |
template<typename T , typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type> | |
ObjectConverter (T number) | |
Stores a number for later retrieval. More... | |
ObjectConverter (const Outline &outline) | |
Stores an outline object for later retrieval. More... | |
ObjectConverter (const Texture &texture) | |
Stores a texture object for later retrieval. More... | |
ObjectConverter (TextStyle style) | |
Stores a single text style for later retrieval. More... | |
ObjectConverter (TextStyles style) | |
Stores a text style for later retrieval. More... | |
ObjectConverter (std::shared_ptr< RendererData > data) | |
Stores render data for later retrieval. More... | |
const String & | getString () |
Retrieves the saved string. More... | |
const Font & | getFont () |
Retrieves the saved font. More... | |
const Color & | getColor () |
Retrieves the saved color. More... | |
const Outline & | getOutline () |
Retrieves the saved outline. More... | |
bool | getBool () |
Retrieves the saved boolean. More... | |
float | getNumber () |
Retrieves the saved number. More... | |
const Texture & | getTexture () |
Retrieves the saved texture. More... | |
const TextStyles & | getTextStyle () |
Retrieves the saved text style. More... | |
const std::shared_ptr< RendererData > & | getRenderer () |
Retrieves the saved renderer data. More... | |
Type | getType () const |
Retrieves the type of the object that has been stored. More... | |
bool | operator== (const ObjectConverter &right) const |
Check if the object equals another one. More... | |
bool | operator!= (const ObjectConverter &right) const |
Check if the object differs from another one. More... | |
Implicit converter for settable properties.
|
inline |
Stores a string for later retrieval.
string | String to store |
|
inline |
Stores a string for later retrieval.
string | String to store |
|
inline |
Stores a font object for later retrieval.
font | Font to store |
|
inline |
Stores a color object for later retrieval.
color | Color to store |
|
inline |
Stores a boolean for later retrieval.
value | Boolean to store |
|
inline |
Stores a number for later retrieval.
number | Number to store |
|
inline |
Stores an outline object for later retrieval.
outline | Outline to store |
|
inline |
Stores a texture object for later retrieval.
texture | Texture to store |
|
inline |
Stores a single text style for later retrieval.
style | Text style to store |
|
inline |
Stores a text style for later retrieval.
style | Text style to store |
|
inline |
Stores render data for later retrieval.
data | Renderer data to store |
bool tgui::ObjectConverter::getBool | ( | ) |
Retrieves the saved boolean.
This function will assert when something other than a boolean was saved
const Color & tgui::ObjectConverter::getColor | ( | ) |
Retrieves the saved color.
This function will assert when something other than a color was saved
const Font & tgui::ObjectConverter::getFont | ( | ) |
Retrieves the saved font.
This function will assert when something other than a font was saved
float tgui::ObjectConverter::getNumber | ( | ) |
Retrieves the saved number.
This function will assert when something other than a number was saved
const Outline & tgui::ObjectConverter::getOutline | ( | ) |
Retrieves the saved outline.
This function will assert when something other than a outline was saved
const std::shared_ptr< RendererData > & tgui::ObjectConverter::getRenderer | ( | ) |
Retrieves the saved renderer data.
This function will assert when something other than a renderer data was saved
const String & tgui::ObjectConverter::getString | ( | ) |
Retrieves the saved string.
const TextStyles & tgui::ObjectConverter::getTextStyle | ( | ) |
Retrieves the saved text style.
This function will assert when something other than a text style was saved
const Texture & tgui::ObjectConverter::getTexture | ( | ) |
Retrieves the saved texture.
This function will assert when something other than a texture was saved
Type tgui::ObjectConverter::getType | ( | ) | const |
Retrieves the type of the object that has been stored.
bool tgui::ObjectConverter::operator!= | ( | const ObjectConverter & | right | ) | const |
Check if the object differs from another one.
Objects with different types will always be considered as different, even if using them would have the same outcome
bool tgui::ObjectConverter::operator== | ( | const ObjectConverter & | right | ) | const |
Check if the object equals another one.
Objects with different types will always be considered as different, even if using them would have the same outcome