Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7219 in orxonox.OLD for branches/std/src/lib/util/multi_type.cc


Ignore:
Timestamp:
Mar 12, 2006, 5:14:44 PM (18 years ago)
Author:
bensch
Message:

orxonox/std: less char*

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/util/multi_type.cc

    r7218 r7219  
    9393{
    9494  this->setChar(value);
    95 }
    96 
    97 /**
    98  * @brief creates a multiType out of a C-String
    99  * @param value the Value of this MulitType
    100  */
    101 MultiType::MultiType(const char* value)
    102 {
    103   this->setString(value);
    10495}
    10596
     
    485476 * @returns: the Type as MT_Type
    486477 */
    487 MT_Type MultiType::StringToMultiType(const char* type)
    488 {
    489   if (!strncmp(type, "bool", 4))
     478MT_Type MultiType::StringToMultiType(const std::string& type)
     479{
     480  if (type == "bool")
    490481    return MT_BOOL;
    491   if (!strncmp(type, "int", 3))
     482  if (type == "int")
    492483    return MT_INT;
    493   if (!strncmp(type, "float", 5))
     484  if (type, "float")
    494485    return MT_FLOAT;
    495   if (!strncmp(type, "char", 4))
     486  if (type == "char")
    496487    return MT_CHAR;
    497   if (!strncmp(type, "string", 6))
     488  if (type == "string")
    498489    return MT_STRING;
    499490
Note: See TracChangeset for help on using the changeset viewer.