QSFML
Public Member Functions | Static Public Member Functions | Friends | List of all members
qsf::String Class Reference

(almost) QString castable to sf::String More...

#include <string.hpp>

Inheritance diagram for qsf::String:
Inheritance graph
[legend]

Public Member Functions

template<typename T >
 String (T obj)
 Quite universal constructor. More...
 
 String (std::string obj)
 std::string constructor More...
 
 String (sf::String str)
 sf::String constructor More...
 
template<typename T >
String arg (T var) const
 QString::arg() method overload, takes any supported type. More...
 
String arg (sf::String str) const
 QString::arg() method overload, takes sf::String as parameter. More...
 
String arg (String str) const
 QString::arg() method overload, takes qsf::String as parameter. More...
 
 operator sf::String const ()
 Operator allowing casting to sf::String. More...
 

Static Public Member Functions

template<typename T >
static String number (T num)
 QString::number() method overload. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const String &string)
 std::ostream << operator support More...
 

Detailed Description

(almost) QString castable to sf::String

Use this class to operate on QString and use it in sf::Text::setString() etc.

Constructor & Destructor Documentation

template<typename T >
qsf::String::String ( obj)
inline

Quite universal constructor.

Parameters
[in]obj– object/variable

Can take as parameter any variable or object, that can be given to QString constructor.
Calls QString(ojb).

qsf::String::String ( std::string  obj)

std::string constructor

Parameters
[in]obj– std::string instance

Allows initializing String using std::string object.

qsf::String::String ( sf::String  str)

sf::String constructor

Parameters
[in]obj– sf::String instance

Allows initializing String using sf::String object.

Member Function Documentation

template<typename T >
String qsf::String::arg ( var) const
inline

QString::arg() method overload, takes any supported type.

Parameters
[in]var– Argument

Overload QString::arg() method from QString, so it could return qsf::String

String qsf::String::arg ( sf::String  str) const

QString::arg() method overload, takes sf::String as parameter.

Parameters
[in]var– Argument

Overload QString::arg() method from QString taking sf::String as parameter.

String qsf::String::arg ( String  str) const

QString::arg() method overload, takes qsf::String as parameter.

Parameters
[in]var– Argument

Overload QString::arg() method from QString taking qsf::String as parameter.

template<typename T >
static String qsf::String::number ( num)
inlinestatic

QString::number() method overload.

Parameters
[in]num– Number

Does exact same thing as QString::number(), but returns qsf::String instead of QString.

qsf::String::operator sf::String const ( )

Operator allowing casting to sf::String.

qsf::String str = QDateTime::currentDateTime().toString();
someSfmlText.setString(str); //OK

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const String string 
)
friend

std::ostream << operator support

Allows printing qsf::String to std::ostream like that:

qsf::String str = QDateTime::currentDateTime().toString();
std::cout << str << std::endl;

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