Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 27, 2009, 2:30:06 AM (14 years ago)
Author:
rgrieder
Message:

Replaced "=" with " = " in our ini files for the config value.
Also made some changes to have const std::string& forwarding with getValue().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/ConfigFileManager.cc

    r6422 r6425  
    5858    }
    5959
    60     std::string getConfig(const std::string& classname, const std::string& varname)
     60    const std::string& getConfig(const std::string& classname, const std::string& varname)
    6161    {
    6262        return ConfigFileManager::getInstance().getValue(ConfigFileType::Settings, classname, varname, "", true);
     
    9494    //////////////////////////
    9595
    96     void ConfigFileEntryValue::setValue(const std::string& value)
    97     {
    98         if (!this->bString_)
    99             this->value_ = value;
     96    void ConfigFileEntryValue::update()
     97    {
     98        // Make sure we remove the quotes when bString changes
     99        if (this->bString_)
     100            this->value_ = stripEnclosingQuotes(this->value_);
     101        // Assemble the entry line
     102        this->fileEntry_ = this->getKeyString() + " = ";
     103        if (this->bString_)
     104            this->fileEntry_ += '"' + addSlashes(this->value_) + '"';
    100105        else
    101             this->value_ = '"' + addSlashes(stripEnclosingQuotes(value)) + '"';
    102     }
    103 
    104     std::string ConfigFileEntryValue::getValue() const
    105     {
    106         if (!this->bString_)
    107             return this->value_;
    108         else
    109             return removeSlashes(stripEnclosingQuotes(this->value_));
    110     }
    111 
    112     std::string ConfigFileEntryValue::getFileEntry() const
    113     {
    114         if (this->additionalComment_.empty())
    115             return (this->name_ + '=' + this->value_);
    116         else
    117             return (this->name_ + '=' + this->value_ + " " + this->additionalComment_);
     106            this->fileEntry_ += this->value_;
     107        if (!this->additionalComment_.empty())
     108            this->fileEntry_ += ' ' + this->additionalComment_;
    118109    }
    119110
     
    122113    // ConfigFileEntryVectorValue //
    123114    ////////////////////////////////
    124     std::string ConfigFileEntryVectorValue::getFileEntry() const
    125     {
    126         if (this->additionalComment_.empty())
    127             return (this->name_ + '[' + multi_cast<std::string>(this->index_) + ']' + '=' + this->value_);
    128         else
    129             return (this->name_ + '[' + multi_cast<std::string>(this->index_) + "]=" + this->value_ + ' ' + this->additionalComment_);
     115    void ConfigFileEntryVectorValue::update()
     116    {
     117        this->keyString_ = this->name_ + '[' + multi_cast<std::string>(this->index_) + ']';
     118        ConfigFileEntryValue::update();
    130119    }
    131120
Note: See TracChangeset for help on using the changeset viewer.