Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2008, 2:18:55 AM (16 years ago)
Author:
landauf
Message:

changed the previously implemented assimilate function to take an optional default-value and to return false if the conversion failed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/util/MultiTypeString.cc

    r1319 r1320  
    136136}
    137137
    138 void MultiTypeString::assimilate(const MultiTypeString& mts)
     138bool MultiTypeString::assimilate(const MultiTypeString& mts, const MultiTypeString& defvalue)
    139139{
    140140    if (this->type_ == MT_constchar)
    141         this->string_ = mts.toString();
     141        return ConvertValue(&this->string_, mts, defvalue.string_);
    142142    else if (this->type_ == MT_string)
    143         this->string_ = mts.toString();
     143        return ConvertValue(&this->string_, mts, defvalue.string_);
    144144    else
    145         MultiTypePrimitive::assimilate(mts);
     145        return MultiTypePrimitive::assimilate(mts, defvalue);
    146146}
    147147
Note: See TracChangeset for help on using the changeset viewer.