Changeset 3265 for code/branches/core4/src/util
- Timestamp:
- Jul 1, 2009, 1:24:30 PM (15 years ago)
- Location:
- code/branches/core4/src/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/util/Convert.h
r3250 r3265 361 361 } 362 362 363 // convert to string Shortcut364 template <class FromType>365 FORCEINLINE std::string convertToString(FromType value)366 {367 return getConvertedValue<FromType, std::string>(value);368 }369 370 // convert from string Shortcut371 template <class ToType>372 FORCEINLINE ToType convertFromString(std::string str)373 {374 return getConvertedValue<std::string, ToType>(str);375 }376 377 363 //////////////////////////////// 378 364 // Special string conversions // -
code/branches/core4/src/util/MultiTypeValue.h
r3257 r3265 139 139 inline operator bool() const { return getConvertedValue<T, bool> (this->value_, 0); } /** @brief Returns the current value, converted to the requested type. */ 140 140 inline operator void*() const { return getConvertedValue<T, void*> (this->value_, 0); } /** @brief Returns the current value, converted to the requested type. */ 141 inline operator std::string() const { return getConvertedValue<T, std::string> (this->value_, zeroise<std::string >()); } /** @brief Returns the current value, converted to the requested type. */142 inline operator orxonox::Vector2() const { return getConvertedValue<T, orxonox::Vector2> (this->value_, zeroise<orxonox::Vector2 >()); } /** @brief Returns the current value, converted to the requested type. */143 inline operator orxonox::Vector3() const { return getConvertedValue<T, orxonox::Vector3> (this->value_, zeroise<orxonox::Vector3 >()); } /** @brief Returns the current value, converted to the requested type. */144 inline operator orxonox::Vector4() const { return getConvertedValue<T, orxonox::Vector4> (this->value_, zeroise<orxonox::Vector4 >()); } /** @brief Returns the current value, converted to the requested type. */145 inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, zeroise<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */146 inline operator orxonox::Quaternion() const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, zeroise<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */147 inline operator orxonox::Radian() const { return getConvertedValue<T, orxonox::Radian> (this->value_, zeroise<orxonox::Radian >()); } /** @brief Returns the current value, converted to the requested type. */148 inline operator orxonox::Degree() const { return getConvertedValue<T, orxonox::Degree> (this->value_, zeroise<orxonox::Degree >()); } /** @brief Returns the current value, converted to the requested type. */141 inline operator std::string() const { return getConvertedValue<T, std::string> (this->value_, NilValue<std::string >()); } /** @brief Returns the current value, converted to the requested type. */ 142 inline operator orxonox::Vector2() const { return getConvertedValue<T, orxonox::Vector2> (this->value_, NilValue<orxonox::Vector2 >()); } /** @brief Returns the current value, converted to the requested type. */ 143 inline operator orxonox::Vector3() const { return getConvertedValue<T, orxonox::Vector3> (this->value_, NilValue<orxonox::Vector3 >()); } /** @brief Returns the current value, converted to the requested type. */ 144 inline operator orxonox::Vector4() const { return getConvertedValue<T, orxonox::Vector4> (this->value_, NilValue<orxonox::Vector4 >()); } /** @brief Returns the current value, converted to the requested type. */ 145 inline operator orxonox::ColourValue() const { return getConvertedValue<T, orxonox::ColourValue>(this->value_, NilValue<orxonox::ColourValue>()); } /** @brief Returns the current value, converted to the requested type. */ 146 inline operator orxonox::Quaternion() const { return getConvertedValue<T, orxonox::Quaternion> (this->value_, NilValue<orxonox::Quaternion >()); } /** @brief Returns the current value, converted to the requested type. */ 147 inline operator orxonox::Radian() const { return getConvertedValue<T, orxonox::Radian> (this->value_, NilValue<orxonox::Radian >()); } /** @brief Returns the current value, converted to the requested type. */ 148 inline operator orxonox::Degree() const { return getConvertedValue<T, orxonox::Degree> (this->value_, NilValue<orxonox::Degree >()); } /** @brief Returns the current value, converted to the requested type. */ 149 149 150 150 /** @brief Puts the current value on the stream */ -
code/branches/core4/src/util/StringUtils.cc
r3250 r3265 44 44 std::string getUniqueNumberString() 45 45 { 46 return convertToString(getUniqueNumber());46 return multi_cast<std::string>(getUniqueNumber()); 47 47 } 48 48
Note: See TracChangeset
for help on using the changeset viewer.