Changeset 1782 for trunk/src


Ignore:
Timestamp:
Jun 28, 2010, 12:19:11 PM (14 years ago)
Author:
dkearney
Message:

patching units code to ignore whitespace within unit strings. adding test cases to the units test suite. this patch is in regard to nanohub ticket #257716

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/RpUnits.cc

    r1740 r1782  
    10251025    const RpUnits* prefix   = NULL;
    10261026
    1027 
    10281027    while ( !myInUnits.empty() ) {
    10291028
     
    10441043            // type = myInUnits[last] + type;
    10451044            // ignore * because we assume everything is multiplied together
     1045            myInUnits.erase(last);
     1046            continue;
     1047        }
     1048
     1049        // ignore whitespace characters
     1050        if (isspace(myInUnits[last])) {
     1051            // ignore whitespace characters, they represent multiplication
    10461052            myInUnits.erase(last);
    10471053            continue;
     
    32883294        retVal = 1;
    32893295    }
    3290     else {
    3291     }
    32923296
    32933297    outUnits = std::string(endptr);
Note: See TracChangeset for help on using the changeset viewer.