TGUI  v0.7.5
tgui::ObjectConverter Class Reference

Implicit converter for settable properties. More...

#include <ObjectConverter.hpp>

Public Member Functions

 ObjectConverter ()
 Default constructor, to create an empty object.
 
 ObjectConverter (const std::shared_ptr< sf::Font > &font)
 Store a font object for later retrieval. More...
 
 ObjectConverter (const sf::Color &color)
 Store a color object for later retrieval. More...
 
 ObjectConverter (const sf::String &string)
 Store a string for later retrieval. More...
 
 ObjectConverter (float number)
 Store a number for later retrieval. More...
 
 ObjectConverter (const Borders &borders)
 Store a borders object for later retrieval. More...
 
 ObjectConverter (const Texture &texture)
 Store a texture object for later retrieval. More...
 
const std::shared_ptr< sf::Font > & getFont () const
 Retrieve the saved font. More...
 
const sf::Color & getColor () const
 Retrieve the saved color. More...
 
const BordersgetBorders () const
 Retrieve the saved borders. More...
 
const sf::String & getString () const
 Retrieve the saved string. More...
 
float getNumber () const
 Retrieve the saved number. More...
 
const TexturegetTexture () const
 Retrieve the saved texture. More...
 
Type getType () const
 Retrieve the type of the object that has been stored. More...
 

Detailed Description

Implicit converter for settable properties.

Constructor & Destructor Documentation

◆ ObjectConverter() [1/6]

tgui::ObjectConverter::ObjectConverter ( const std::shared_ptr< sf::Font > &  font)

Store a font object for later retrieval.

Parameters
fontFont to store

◆ ObjectConverter() [2/6]

tgui::ObjectConverter::ObjectConverter ( const sf::Color &  color)

Store a color object for later retrieval.

Parameters
colorColor to store

◆ ObjectConverter() [3/6]

tgui::ObjectConverter::ObjectConverter ( const sf::String &  string)

Store a string for later retrieval.

Parameters
stringString to store

◆ ObjectConverter() [4/6]

tgui::ObjectConverter::ObjectConverter ( float  number)

Store a number for later retrieval.

Parameters
numberNumber to store

◆ ObjectConverter() [5/6]

tgui::ObjectConverter::ObjectConverter ( const Borders borders)

Store a borders object for later retrieval.

Parameters
bordersBorders to store

◆ ObjectConverter() [6/6]

tgui::ObjectConverter::ObjectConverter ( const Texture texture)

Store a texture object for later retrieval.

Parameters
textureTexture to store

Member Function Documentation

◆ getBorders()

const Borders& tgui::ObjectConverter::getBorders ( ) const

Retrieve the saved borders.

Returns
The saved borders

This function will assert when something other than a borders was saved

◆ getColor()

const sf::Color& tgui::ObjectConverter::getColor ( ) const

Retrieve the saved color.

Returns
The saved color

This function will assert when something other than a color was saved

◆ getFont()

const std::shared_ptr<sf::Font>& tgui::ObjectConverter::getFont ( ) const

Retrieve the saved font.

Returns
The saved font

This function will assert when something other than a font was saved

◆ getNumber()

float tgui::ObjectConverter::getNumber ( ) const

Retrieve the saved number.

Returns
The saved number

This function will assert when something other than a number was saved

◆ getString()

const sf::String& tgui::ObjectConverter::getString ( ) const

Retrieve the saved string.

Returns
The saved string

This function will assert when something other than a string was saved

◆ getTexture()

const Texture& tgui::ObjectConverter::getTexture ( ) const

Retrieve the saved texture.

Returns
The saved texture

This function will assert when something other than a texture was saved

◆ getType()

Type tgui::ObjectConverter::getType ( ) const

Retrieve the type of the object that has been stored.

Returns
The stored object type

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