Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [solved]sf::events::TextEvent question  (Read 2266 times)

0 Members and 1 Guest are viewing this topic.

alwayslearning

  • Newbie
  • *
  • Posts: 12
    • View Profile
[solved]sf::events::TextEvent question
« on: April 13, 2010, 12:49:44 am »
Defined within TextEvent is Uint32 Unicode.

Is there an std type that can natively support the that type in the form of a string?  I'm currently using std::wstring, but warnings are making me cast to wchar_t when saving the event data to the wstring.  Or is wstring the best option?

I just want to make sure I'm not accidently casting away valid data.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[solved]sf::events::TextEvent question
« Reply #1 on: April 13, 2010, 08:20:33 am »
You can make a string of any character type:
Code: [Select]
typedef std::basic_string<sf::Uint32> u32string;

// std::string  is std::basic_string<char>
// std::wstring is std::basic_string<wchar_t>
Laurent Gomila - SFML developer

alwayslearning

  • Newbie
  • *
  • Posts: 12
    • View Profile
[solved]sf::events::TextEvent question
« Reply #2 on: April 14, 2010, 01:15:11 am »
Thanks!