Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2008, 12:48:25 AM (16 years ago)
Author:
landauf
Message:

config-value accepts now strings with special chars like \n or \t and hopefully every other. strings are enclosed by "…", but the quotes are only visible in the config-file. if you want something like " ← whitespace" you must add quotes, otherwise this would be stripped to "← whitespace".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/ConfigValueContainer.cc

    r1036 r1049  
    8888
    8989        for (unsigned int i = 0; i < defvalue.size(); i++)
    90             ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString());
     90            ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, defvalue[i].toString(), this->value_.isA(MT_string));
    9191
    9292        for (unsigned int i = 0; i < defvalue.size(); i++)
     
    123123                this->valueVector_.erase(this->valueVector_.begin() + index);
    124124                for (unsigned int i = index; i < this->valueVector_.size(); i++)
    125                     ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i]);
     125                    ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
    126126                ConfigFileManager::getSingleton()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
    127127
     
    171171
    172172        bool success = this->tset(input);
    173         ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input);
     173        ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isA(MT_string));
    174174        return success;
    175175    }
     
    186186        {
    187187            bool success = this->tset(index, input);
    188             ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input);
     188            ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isA(MT_string));
    189189            return success;
    190190        }
     
    251251    {
    252252        if (!this->bIsVector_)
    253             this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_));
     253            this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));
    254254        else
    255255        {
     
    257257            for (unsigned int i = 0; i < ConfigFileManager::getSingleton()->getVectorSize(this->type_, this->sectionname_, this->varname_); i++)
    258258            {
    259                 this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i]));
     259                this->value_.fromString(ConfigFileManager::getSingleton()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));
    260260                this->valueVector_.push_back(this->value_);
    261261            }
     
    322322                {
    323323                    this->valueVector_.push_back(MultiTypeMath());
    324                     ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i]);
     324                    ConfigFileManager::getSingleton()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isA(MT_string));
    325325                }
    326326            }
Note: See TracChangeset for help on using the changeset viewer.