Changeset 797 for code/branches/core/src/util
- Timestamp:
- Feb 11, 2008, 3:29:16 AM (17 years ago)
- Location:
- code/branches/core/src/util
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core/src/util/MultiTypeMath.cc
r794 r797 105 105 this->value_ = mtm.value_; 106 106 } 107 108 std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm) 109 { 110 if (mtm.isA(MT_vector2)) 111 out << mtm.getVector2(); 112 else if (mtm.isA(MT_vector3)) 113 out << mtm.getVector3(); 114 else if (mtm.isA(MT_colourvalue)) 115 out << mtm.getColourValue(); 116 else if (mtm.isA(MT_quaternion)) 117 out << mtm.getQuaternion(); 118 else if (mtm.isA(MT_radian)) 119 out << mtm.getRadian(); 120 else if (mtm.isA(MT_degree)) 121 out << mtm.getDegree(); 122 else 123 out << ((MultiTypeString)mtm); 124 125 return out; 126 } -
code/branches/core/src/util/MultiTypeMath.h
r794 r797 121 121 }; 122 122 123 std::ostream& operator<<(std::ostream& out, MultiTypeMath& mtm); 124 123 125 #endif /* _MultiTypeMath_H__ */ -
code/branches/core/src/util/MultiTypePrimitive.cc
r792 r797 145 145 this->value_ = mtp.value_; 146 146 } 147 148 std::ostream& operator<<(std::ostream& out, const MultiTypePrimitive& mtp) 149 { 150 if (mtp.isA(MT_int)) 151 out << mtp.getInt(); 152 else if (mtp.isA(MT_uint)) 153 out << mtp.getUnsignedInt(); 154 else if (mtp.isA(MT_char)) 155 out << mtp.getChar(); 156 else if (mtp.isA(MT_uchar)) 157 out << mtp.getUnsignedChar(); 158 else if (mtp.isA(MT_short)) 159 out << mtp.getShort(); 160 else if (mtp.isA(MT_ushort)) 161 out << mtp.getUnsignedShort(); 162 else if (mtp.isA(MT_long)) 163 out << mtp.getLong(); 164 else if (mtp.isA(MT_ulong)) 165 out << mtp.getUnsignedLong(); 166 else if (mtp.isA(MT_float)) 167 out << mtp.getFloat(); 168 else if (mtp.isA(MT_double)) 169 out << mtp.getDouble(); 170 else if (mtp.isA(MT_longdouble)) 171 out << mtp.getLongDouble(); 172 else if (mtp.isA(MT_bool)) 173 out << mtp.getBool(); 174 175 return out; 176 } -
code/branches/core/src/util/MultiTypePrimitive.h
r794 r797 29 29 #ifndef _MultiTypePrimitive_H__ 30 30 #define _MultiTypePrimitive_H__ 31 32 #include <ostream> 31 33 32 34 #include "UtilPrereqs.h" … … 142 144 }; 143 145 146 std::ostream& operator<<(std::ostream& out, const MultiTypePrimitive& mtp); 147 144 148 #endif /* _MultiTypePrimitive_H__ */ -
code/branches/core/src/util/MultiTypeString.cc
r794 r797 81 81 this->value_ = mts.value_; 82 82 } 83 84 std::ostream& operator<<(std::ostream& out, MultiTypeString& mts) 85 { 86 if (mts.isA(MT_constchar)) 87 out << mts.getConstChar(); 88 else if (mts.isA(MT_string)) 89 out << mts.getString(); 90 else 91 out << ((MultiTypePrimitive)mts); 92 93 return out; 94 } -
code/branches/core/src/util/MultiTypeString.h
r794 r797 76 76 void setValue(const MultiTypeString& mtp); 77 77 78 inline std::string& getString() { return this->string_; } 78 inline std::string& getString() { return this->string_; } 79 inline const char* getConstChar() { return this->string_.c_str(); } 79 80 80 81 using MultiTypePrimitive::getValue; 81 inline void getValue(std::string* variable) const { (*variable) = std::string(this->string_); } 82 inline void getValue(std::string* variable) const { (*variable) = this->string_; } 83 inline void getValue(const char** variable) const { (*variable) = this->string_.c_str(); } 82 84 83 85 protected: … … 85 87 }; 86 88 89 std::ostream& operator<<(std::ostream& out, MultiTypeString& mts); 90 87 91 #endif /* _MultiTypeString_H__ */
Note: See TracChangeset
for help on using the changeset viewer.