Bromeon
Static Public Member Functions | Public Member Functions | Related Functions
thor::Resources::FontKey Class Reference

Predefined key class for sf::Font resources. More...

List of all members.

Static Public Member Functions

static FontKey FromFile (const std::string &fileName, const std::string &tag="")
 Load sf::Font from file name.
static FontKey FromMemory (const void *data, std::size_t size, const std::string &tag="")
 Load sf::Font from file in memory.
static FontKey FromStream (sf::InputStream &stream, const std::string &tag="")
 Load sf::Font from input stream.

Public Member Functions

MovedPtr< sf::Font, NoCopyLoad () const
 Loads the font as specified by the static functions.
void Swap (FontKey &other)
 Exchanges the contents of *this with other.

Related Functions

bool thor::Resources::operator< (const FontKey &lhs, const FontKey &rhs)
 Comparison operator for strict weak ordering.
void thor::Resources::swap (FontKey &lhs, FontKey &rhs)
 Swaps two sf::Font resource keys.

Detailed Description

Predefined key class for sf::Font resources.

You can use this class to specifiy the access and loading of sf::Font resources in a ResourceManager.


Member Function Documentation

static FontKey thor::Resources::FontKey::FromFile ( const std::string &  fileName,
const std::string &  tag = "" 
) [static]

Load sf::Font from file name.

Parameters:
fileNameThe name of the file from which you want to load the sf::Font.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Font::LoadFromFile()
static FontKey thor::Resources::FontKey::FromMemory ( const void *  data,
std::size_t  size,
const std::string &  tag = "" 
) [static]

Load sf::Font from file in memory.

Parameters:
dataPointer to the file data in memory.
sizeSize of the data to load, in bytes.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Font::LoadFromMemory()
static FontKey thor::Resources::FontKey::FromStream ( sf::InputStream &  stream,
const std::string &  tag = "" 
) [static]

Load sf::Font from input stream.

Parameters:
streamSource stream to read from.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Font::LoadFromStream()

Loads the font as specified by the static functions.

This function is mainly provided for ResourceManager, you don't need to call it directly.

Returns:
Movable smart pointer to the allocated sf::Font, or null pointer at loading failure.

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