Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 5, 2008, 7:38:28 PM (16 years ago)
Author:
landauf
Message:

hopefully fixed the bug in XMLPort and Converter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core/src/util/Convert.h

    r853 r854  
    226226        return ConvertValue(output, input.getString());
    227227      else
    228         return false;
     228        return ConvertValue(output, (MultiTypePrimitive)input);
    229229    }
    230230};
     
    240240        return ConvertValue(output, input.getString());
    241241      else
    242         return false;
     242        return ConvertValue(output, (MultiTypePrimitive)input);
    243243    }
    244244};
     
    264264        return ConvertValue(output, input.getDegree());
    265265      else
    266         return false;
     266        return ConvertValue(output, (MultiTypeString)input);
    267267    }
    268268};
     
    286286        return ConvertValue(output, input.getDegree());
    287287      else
    288         return false;
     288        return ConvertValue(output, (MultiTypeString)input);
    289289    }
    290290};
     
    397397    bool operator()(orxonox::Vector2* output, const std::string& input) const
    398398    {
    399       SubString tokens(input, ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
     399      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
     400      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     401
     402      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
    400403
    401404      if (tokens.size() >= 2)
     
    420423    bool operator()(orxonox::Vector3* output, const std::string& input) const
    421424    {
    422       SubString tokens(input, ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
     425      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
     426      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     427
     428      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
    423429
    424430      if (tokens.size() >= 3)
     
    445451    bool operator()(orxonox::Vector4* output, const std::string& input) const
    446452    {
    447       SubString tokens(input, ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
     453      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
     454      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     455
     456      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
    448457
    449458      if (tokens.size() >= 4)
     
    472481    bool operator()(orxonox::Quaternion* output, const std::string& input) const
    473482    {
    474       SubString tokens(input, ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
     483      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
     484      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     485
     486      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
    475487
    476488      if (tokens.size() >= 4)
     
    499511    bool operator()(orxonox::ColourValue* output, const std::string& input) const
    500512    {
    501       SubString tokens(input, ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
     513      unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
     514      if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
     515
     516      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
    502517
    503518      if (tokens.size() >= 4)
Note: See TracChangeset for help on using the changeset viewer.