Changeset 6135 for code/branches/presentation2/src/libraries
- Timestamp:
- Nov 24, 2009, 2:17:38 AM (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/util/DisplayStringConversions.h
r6133 r6135 33 33 */ 34 34 35 #ifndef _ UTFStringConversions_H__36 #define _ UTFStringConversions_H__35 #ifndef _DisplayStringConversions_H__ 36 #define _DisplayStringConversions_H__ 37 37 38 38 #include "UtilPrereqs.h" 39 #include <Ogre UTFString.h>39 #include <OgreOverlayElement.h> 40 40 41 namespace orxonox 42 { 43 template <> 44 struct ConverterExplicit<std::string, Ogre::UTFString>41 #if OGRE_UNICODE_SUPPORT 42 #include <OgreUTFString.h> 43 44 namespace orxonox 45 45 { 46 //! Converts an std::string into an Ogre::UTFString47 inline static bool convert(Ogre::UTFString* output, const std::string& input)46 template <> 47 struct ConverterExplicit<std::string, Ogre::DisplayString> 48 48 { 49 Ogre::UTFString::code_point cp;50 for (unsigned int i = 0; i < input.size(); ++i)49 //! Converts an std::string into an Ogre::UTFString 50 inline static bool convert(Ogre::DisplayString* output, const std::string& input) 51 51 { 52 cp = input[i]; 53 cp &= 0xFF; 54 output->append(1, cp); 52 Ogre::UTFString::code_point cp; 53 for (unsigned int i = 0; i < input.size(); ++i) 54 { 55 cp = input[i]; 56 cp &= 0xFF; 57 output->append(1, cp); 58 } 59 return true; 55 60 } 56 return true; 57 } 58 }; 59 } 61 }; 62 } 63 #else 64 namespace orxonox 65 { 66 template <> 67 struct ConverterExplicit<std::string, Ogre::DisplayString> 68 { 69 //! Converts an std::string into an Ogre::String 70 inline static bool convert(Ogre::DisplayString* output, const std::string& input) 71 { 72 *output = input; 73 return true; 74 } 75 }; 76 } 77 #endif 60 78 61 #endif /* _ UTFStringConversions_H__ */79 #endif /* _DisplayStringConversions_H__ */
Note: See TracChangeset
for help on using the changeset viewer.