Changeset 7219 in orxonox.OLD for branches/std/src/lib/util/multi_type.cc
- Timestamp:
- Mar 12, 2006, 5:14:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/util/multi_type.cc
r7218 r7219 93 93 { 94 94 this->setChar(value); 95 }96 97 /**98 * @brief creates a multiType out of a C-String99 * @param value the Value of this MulitType100 */101 MultiType::MultiType(const char* value)102 {103 this->setString(value);104 95 } 105 96 … … 485 476 * @returns: the Type as MT_Type 486 477 */ 487 MT_Type MultiType::StringToMultiType(const char*type)488 { 489 if ( !strncmp(type, "bool", 4))478 MT_Type MultiType::StringToMultiType(const std::string& type) 479 { 480 if (type == "bool") 490 481 return MT_BOOL; 491 if ( !strncmp(type, "int", 3))482 if (type == "int") 492 483 return MT_INT; 493 if ( !strncmp(type, "float", 5))484 if (type, "float") 494 485 return MT_FLOAT; 495 if ( !strncmp(type, "char", 4))486 if (type == "char") 496 487 return MT_CHAR; 497 if ( !strncmp(type, "string", 6))488 if (type == "string") 498 489 return MT_STRING; 499 490
Note: See TracChangeset
for help on using the changeset viewer.