Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2007, 11:33:10 PM (16 years ago)
Author:
rgrieder
Message:
  • the master has spoken…
  • misc/String.h is not anymore..
File:
1 edited

Legend:

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

    r708 r715  
    4343        @param defvalue The default-value
    4444    */
    45     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, int defvalue)
     45    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, int defvalue)
    4646    {
    4747        this->bAddedDescription_ = false;
     
    5353        this->searchConfigFileLine();                                               // Search the entry in the config-file
    5454
    55         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    56         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    57             this->resetConfigFileEntry();                                           // The conversion failed
    58     }
    59 
    60     /**
    61         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    62         @param value This is only needed to determine the right type.
    63         @param classname The name of the class the variable belongs to
    64         @param varname The name of the variable
    65         @param defvalue The default-value
    66     */
    67     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, unsigned int defvalue)
     55        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     56        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     57            this->resetConfigFileEntry();                                           // The conversion failed
     58    }
     59
     60    /**
     61        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     62        @param value This is only needed to determine the right type.
     63        @param classname The name of the class the variable belongs to
     64        @param varname The name of the variable
     65        @param defvalue The default-value
     66    */
     67    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned int defvalue)
    6868    {
    6969        this->bAddedDescription_ = false;
     
    7575        this->searchConfigFileLine();                                               // Search the entry in the config-file
    7676
    77         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    78         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    79             this->resetConfigFileEntry();                                           // The conversion failed
    80     }
    81 
    82     /**
    83         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    84         @param value This is only needed to determine the right type.
    85         @param classname The name of the class the variable belongs to
    86         @param varname The name of the variable
    87         @param defvalue The default-value
    88     */
    89     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, char defvalue)
     77        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     78        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     79            this->resetConfigFileEntry();                                           // The conversion failed
     80    }
     81
     82    /**
     83        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     84        @param value This is only needed to determine the right type.
     85        @param classname The name of the class the variable belongs to
     86        @param varname The name of the variable
     87        @param defvalue The default-value
     88    */
     89    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, char defvalue)
    9090    {
    9191        this->bAddedDescription_ = false;
     
    9797        this->searchConfigFileLine();                                               // Search the entry in the config-file
    9898
    99         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    100         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    101             this->resetConfigFileEntry();                                           // The conversion failed
    102     }
    103 
    104     /**
    105         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    106         @param value This is only needed to determine the right type.
    107         @param classname The name of the class the variable belongs to
    108         @param varname The name of the variable
    109         @param defvalue The default-value
    110     */
    111     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, unsigned char defvalue)
     99        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     100        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     101            this->resetConfigFileEntry();                                           // The conversion failed
     102    }
     103
     104    /**
     105        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     106        @param value This is only needed to determine the right type.
     107        @param classname The name of the class the variable belongs to
     108        @param varname The name of the variable
     109        @param defvalue The default-value
     110    */
     111    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, unsigned char defvalue)
    112112    {
    113113        this->bAddedDescription_ = false;
     
    119119        this->searchConfigFileLine();                                               // Search the entry in the config-file
    120120
    121         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    122         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    123             this->resetConfigFileEntry();                                           // The conversion failed
    124     }
    125 
    126     /**
    127         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    128         @param value This is only needed to determine the right type.
    129         @param classname The name of the class the variable belongs to
    130         @param varname The name of the variable
    131         @param defvalue The default-value
    132     */
    133     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, float defvalue)
     121        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     122        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     123            this->resetConfigFileEntry();                                           // The conversion failed
     124    }
     125
     126    /**
     127        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     128        @param value This is only needed to determine the right type.
     129        @param classname The name of the class the variable belongs to
     130        @param varname The name of the variable
     131        @param defvalue The default-value
     132    */
     133    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, float defvalue)
    134134    {
    135135        this->bAddedDescription_ = false;
     
    141141        this->searchConfigFileLine();                                               // Search the entry in the config-file
    142142
    143         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    144         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    145             this->resetConfigFileEntry();                                           // The conversion failed
    146     }
    147 
    148     /**
    149         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    150         @param value This is only needed to determine the right type.
    151         @param classname The name of the class the variable belongs to
    152         @param varname The name of the variable
    153         @param defvalue The default-value
    154     */
    155     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, double defvalue)
     143        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     144        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     145            this->resetConfigFileEntry();                                           // The conversion failed
     146    }
     147
     148    /**
     149        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     150        @param value This is only needed to determine the right type.
     151        @param classname The name of the class the variable belongs to
     152        @param varname The name of the variable
     153        @param defvalue The default-value
     154    */
     155    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, double defvalue)
    156156    {
    157157        this->bAddedDescription_ = false;
     
    163163        this->searchConfigFileLine();                                               // Search the entry in the config-file
    164164
    165         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    166         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    167             this->resetConfigFileEntry();                                           // The conversion failed
    168     }
    169 
    170     /**
    171         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    172         @param value This is only needed to determine the right type.
    173         @param classname The name of the class the variable belongs to
    174         @param varname The name of the variable
    175         @param defvalue The default-value
    176     */
    177     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, long double defvalue)
     165        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     166        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     167            this->resetConfigFileEntry();                                           // The conversion failed
     168    }
     169
     170    /**
     171        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     172        @param value This is only needed to determine the right type.
     173        @param classname The name of the class the variable belongs to
     174        @param varname The name of the variable
     175        @param defvalue The default-value
     176    */
     177    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, long double defvalue)
    178178    {
    179179        this->bAddedDescription_ = false;
     
    185185        this->searchConfigFileLine();                                               // Search the entry in the config-file
    186186
    187         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    188         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    189             this->resetConfigFileEntry();                                           // The conversion failed
    190     }
    191 
    192     /**
    193         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    194         @param value This is only needed to determine the right type.
    195         @param classname The name of the class the variable belongs to
    196         @param varname The name of the variable
    197         @param defvalue The default-value
    198     */
    199     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, bool defvalue)
     187        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     188        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     189            this->resetConfigFileEntry();                                           // The conversion failed
     190    }
     191
     192    /**
     193        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     194        @param value This is only needed to determine the right type.
     195        @param classname The name of the class the variable belongs to
     196        @param varname The name of the variable
     197        @param defvalue The default-value
     198    */
     199    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, bool defvalue)
    200200    {
    201201        this->bAddedDescription_ = false;
     
    211211
    212212        this->searchConfigFileLine();                                               // Search the entry in the config-file
    213         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    214         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    215             this->resetConfigFileEntry();                                           // The conversion failed
    216     }
    217 
    218     /**
    219         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    220         @param value This is only needed to determine the right type.
    221         @param classname The name of the class the variable belongs to
    222         @param varname The name of the variable
    223         @param defvalue The default-value
    224     */
    225     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, const String& defvalue)
     213        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     214        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     215            this->resetConfigFileEntry();                                           // The conversion failed
     216    }
     217
     218    /**
     219        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     220        @param value This is only needed to determine the right type.
     221        @param classname The name of the class the variable belongs to
     222        @param varname The name of the variable
     223        @param defvalue The default-value
     224    */
     225    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, const std::string& defvalue)
    226226    {
    227227        this->bAddedDescription_ = false;
     
    232232        this->defvalueString_ = "\"" + defvalue + "\"";                             // Convert the string to a "config-file-string" with quotes
    233233        this->searchConfigFileLine();                                               // Search the entry in the config-file
    234         String valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
    235         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    236             this->resetConfigFileEntry();                                           // The conversion failed
    237     }
    238 
    239     /**
    240         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    241         @param value This is only needed to determine the right type.
    242         @param classname The name of the class the variable belongs to
    243         @param varname The name of the variable
    244         @param defvalue The default-value
    245     */
    246     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, const char* defvalue)
     234        std::string valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
     235        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     236            this->resetConfigFileEntry();                                           // The conversion failed
     237    }
     238
     239    /**
     240        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     241        @param value This is only needed to determine the right type.
     242        @param classname The name of the class the variable belongs to
     243        @param varname The name of the variable
     244        @param defvalue The default-value
     245    */
     246    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, const char* defvalue)
    247247    {
    248248        this->bAddedDescription_ = false;
     
    251251        this->type_ = ConstChar;
    252252
    253         this->defvalueString_ = "\"" + String(defvalue) + "\"";                // Convert the string to a "config-file-string" with quotes
    254         this->searchConfigFileLine();                                               // Search the entry in the config-file
    255         String valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
    256         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    257             this->resetConfigFileEntry();                                           // The conversion failed
    258     }
    259 
    260     /**
    261         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    262         @param value This is only needed to determine the right type.
    263         @param classname The name of the class the variable belongs to
    264         @param varname The name of the variable
    265         @param defvalue The default-value
    266     */
    267     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, Vector2 defvalue)
     253        this->defvalueString_ = "\"" + std::string(defvalue) + "\"";                // Convert the string to a "config-file-string" with quotes
     254        this->searchConfigFileLine();                                               // Search the entry in the config-file
     255        std::string valueString = this->parseValueString(false);                    // Parses the value string from the config-file-entry
     256        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     257            this->resetConfigFileEntry();                                           // The conversion failed
     258    }
     259
     260    /**
     261        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     262        @param value This is only needed to determine the right type.
     263        @param classname The name of the class the variable belongs to
     264        @param varname The name of the variable
     265        @param defvalue The default-value
     266    */
     267    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, Vector2 defvalue)
    268268    {
    269269        this->bAddedDescription_ = false;
     
    280280
    281281        this->searchConfigFileLine();                                               // Search the entry in the config-file
    282         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    283         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    284             this->resetConfigFileEntry();                                           // The conversion failed
    285     }
    286 
    287     /**
    288         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    289         @param value This is only needed to determine the right type.
    290         @param classname The name of the class the variable belongs to
    291         @param varname The name of the variable
    292         @param defvalue The default-value
    293     */
    294     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, Vector3 defvalue)
     282        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     283        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     284            this->resetConfigFileEntry();                                           // The conversion failed
     285    }
     286
     287    /**
     288        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     289        @param value This is only needed to determine the right type.
     290        @param classname The name of the class the variable belongs to
     291        @param varname The name of the variable
     292        @param defvalue The default-value
     293    */
     294    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, Vector3 defvalue)
    295295    {
    296296        this->bAddedDescription_ = false;
     
    307307
    308308        this->searchConfigFileLine();                                               // Search the entry in the config-file
    309         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    310         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    311             this->resetConfigFileEntry();                                           // The conversion failed
    312     }
    313 
    314     /**
    315         @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
    316         @param value This is only needed to determine the right type.
    317         @param classname The name of the class the variable belongs to
    318         @param varname The name of the variable
    319         @param defvalue The default-value
    320     */
    321     ConfigValueContainer::ConfigValueContainer(const String& classname, const String& varname, ColourValue defvalue)
     309        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     310        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     311            this->resetConfigFileEntry();                                           // The conversion failed
     312    }
     313
     314    /**
     315        @brief Constructor: Converts the default-value to a string, checks the config-file for a changed value, sets the intern value variable.
     316        @param value This is only needed to determine the right type.
     317        @param classname The name of the class the variable belongs to
     318        @param varname The name of the variable
     319        @param defvalue The default-value
     320    */
     321    ConfigValueContainer::ConfigValueContainer(const std::string& classname, const std::string& varname, ColourValue defvalue)
    322322    {
    323323        this->bAddedDescription_ = false;
     
    334334
    335335        this->searchConfigFileLine();                                               // Search the entry in the config-file
    336         String valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
    337         if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
    338             this->resetConfigFileEntry();                                           // The conversion failed
    339     }
    340 
    341     /**
    342         @brief Parses a given String into a value of the type of the associated variable and assigns it.
    343         @param input The string to convert
    344         @return True if the string was successfully parsed
    345     */
    346     bool ConfigValueContainer::parseSting(const String& input)
     336        std::string valueString = this->parseValueString();                         // Parses the value string from the config-file-entry
     337        if (!this->parseSting(valueString, defvalue))                               // Try to convert the string to a value
     338            this->resetConfigFileEntry();                                           // The conversion failed
     339    }
     340
     341    /**
     342        @brief Parses a given std::string into a value of the type of the associated variable and assigns it.
     343        @param input The string to convert
     344        @return True if the string was successfully parsed
     345    */
     346    bool ConfigValueContainer::parseSting(const std::string& input)
    347347    {
    348348        if (this->type_ == ConfigValueContainer::Int)
     
    382382        @return True if the string was successfully parsed
    383383    */
    384     bool ConfigValueContainer::parseSting(const String& input, int defvalue)
     384    bool ConfigValueContainer::parseSting(const std::string& input, int defvalue)
    385385    {
    386386        return string2Number(this->value_.value_int_, input, defvalue);
     
    393393        @return True if the string was successfully parsed
    394394    */
    395     bool ConfigValueContainer::parseSting(const String& input, unsigned int defvalue)
     395    bool ConfigValueContainer::parseSting(const std::string& input, unsigned int defvalue)
    396396    {
    397397        return string2Number(this->value_.value_uint_, input, defvalue);
     
    404404        @return True if the string was successfully parsed
    405405    */
    406     bool ConfigValueContainer::parseSting(const String& input, char defvalue)
     406    bool ConfigValueContainer::parseSting(const std::string& input, char defvalue)
    407407    {
    408408        // I used value_int_ instead of value_char_ to avoid number <-> char confusion in the config-file
     
    416416        @return True if the string was successfully parsed
    417417    */
    418     bool ConfigValueContainer::parseSting(const String& input, unsigned char defvalue)
     418    bool ConfigValueContainer::parseSting(const std::string& input, unsigned char defvalue)
    419419    {
    420420        // I used value_uint_ instead of value_uchar_ to avoid number <-> char confusion in the config-file
     
    428428        @return True if the string was successfully parsed
    429429    */
    430     bool ConfigValueContainer::parseSting(const String& input, float defvalue)
     430    bool ConfigValueContainer::parseSting(const std::string& input, float defvalue)
    431431    {
    432432        return string2Number(this->value_.value_float_, input, defvalue);
     
    439439        @return True if the string was successfully parsed
    440440    */
    441     bool ConfigValueContainer::parseSting(const String& input, double defvalue)
     441    bool ConfigValueContainer::parseSting(const std::string& input, double defvalue)
    442442    {
    443443        return string2Number(this->value_.value_double_, input, defvalue);
     
    450450        @return True if the string was successfully parsed
    451451    */
    452     bool ConfigValueContainer::parseSting(const String& input, long double defvalue)
     452    bool ConfigValueContainer::parseSting(const std::string& input, long double defvalue)
    453453    {
    454454        return string2Number(this->value_.value_long_double_, input, defvalue);
     
    461461        @return True if the string was successfully parsed
    462462    */
    463     bool ConfigValueContainer::parseSting(const String& input, bool defvalue)
     463    bool ConfigValueContainer::parseSting(const std::string& input, bool defvalue)
    464464    {
    465465        // Try to parse the value-string - is it a word?
     
    489489        @return True if the string was successfully parsed
    490490    */
    491     bool ConfigValueContainer::parseSting(const String& input, const String& defvalue)
     491    bool ConfigValueContainer::parseSting(const std::string& input, const std::string& defvalue)
    492492    {
    493493        // Strip the quotes
     
    514514        @return True if the string was successfully parsed
    515515    */
    516     bool ConfigValueContainer::parseSting(const String& input, const char* defvalue)
     516    bool ConfigValueContainer::parseSting(const std::string& input, const char* defvalue)
    517517    {
    518518        // Strip the quotes
     
    539539        @return True if the string was successfully parsed
    540540    */
    541     bool ConfigValueContainer::parseSting(const String& input, const Vector2& defvalue)
     541    bool ConfigValueContainer::parseSting(const std::string& input, const Vector2& defvalue)
    542542    {
    543543        // Strip the value-string
     
    548548        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
    549549        {
    550             std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
     550            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
    551551            if (!string2Number(this->value_vector2_.x, tokens[0], defvalue.x))
    552552            {
     
    573573        @return True if the string was successfully parsed
    574574    */
    575     bool ConfigValueContainer::parseSting(const String& input, const Vector3& defvalue)
     575    bool ConfigValueContainer::parseSting(const std::string& input, const Vector3& defvalue)
    576576    {
    577577        // Strip the value-string
     
    582582        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
    583583        {
    584             std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
     584            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
    585585            if (!string2Number(this->value_vector3_.x, tokens[0], defvalue.x))
    586586            {
     
    612612        @return True if the string was successfully parsed
    613613    */
    614     bool ConfigValueContainer::parseSting(const String& input, const ColourValue& defvalue)
     614    bool ConfigValueContainer::parseSting(const std::string& input, const ColourValue& defvalue)
    615615    {
    616616        // Strip the value-string
     
    621621        if (pos1 < input.length() && pos2 < input.length() && pos1 < pos2)
    622622        {
    623             std::vector<String> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
     623            std::vector<std::string> tokens = tokenize(input.substr(pos1, pos2 - pos1), ",");
    624624            if (!string2Number(this->value_colourvalue_.r, tokens[0], defvalue.r))
    625625            {
     
    678678
    679679        // The string of the section we're searching
    680         String section = "";
     680        std::string section = "";
    681681        section.append("[");
    682682        section.append(this->classname_);
     
    685685        // Iterate through all config-file-lines
    686686        bool success = false;
    687         std::list<String>::iterator it1;
     687        std::list<std::string>::iterator it1;
    688688        for(it1 = ConfigValueContainer::getConfigFileLines().begin(); it1 != ConfigValueContainer::getConfigFileLines().end(); ++it1)
    689689        {
     
    696696                // We found the right section
    697697                bool bLineIsEmpty = false;
    698                 std::list<String>::iterator positionToPutNewLineAt;
     698                std::list<std::string>::iterator positionToPutNewLineAt;
    699699
    700700                // Iterate through all lines in the section
    701                 std::list<String>::iterator it2;
     701                std::list<std::string>::iterator it2;
    702702                for(it2 = ++it1; it2 != ConfigValueContainer::getConfigFileLines().end(); ++it2)
    703703                {
     
    777777        @return True = it's a comment
    778778    */
    779     bool ConfigValueContainer::isComment(const String& line)
     779    bool ConfigValueContainer::isComment(const std::string& line)
    780780    {
    781781        // Strip the line, whitespaces are disturbing
    782         String teststring = getStrippedLine(line);
     782        std::string teststring = getStrippedLine(line);
    783783
    784784        // There are four possible comment-symbols:
     
    798798        @return True = it's empty
    799799    */
    800     bool ConfigValueContainer::isEmpty(const String& line)
     800    bool ConfigValueContainer::isEmpty(const std::string& line)
    801801    {
    802802        return getStrippedLine(line) == "";
     
    808808        @return The stripped line
    809809    */
    810     String ConfigValueContainer::getStrippedLine(const String& line)
    811     {
    812         String output = line;
     810    std::string ConfigValueContainer::getStrippedLine(const std::string& line)
     811    {
     812        std::string output = line;
    813813        unsigned int pos;
    814814        while ((pos = output.find(" ")) < output.length())
     
    825825        @return The value-string
    826826    */
    827     String ConfigValueContainer::parseValueString(bool bStripped)
    828     {
    829         String output;
     827    std::string ConfigValueContainer::parseValueString(bool bStripped)
     828    {
     829        std::string output;
    830830        if (bStripped)
    831831            output = this->getStrippedLine(*this->configFileLine_);
     
    839839        @returns a list, containing all entrys in the config-file.
    840840    */
    841     std::list<String>& ConfigValueContainer::getConfigFileLines()
     841    std::list<std::string>& ConfigValueContainer::getConfigFileLines()
    842842    {
    843843        // This is done to avoid problems while executing this code before main()
    844         static std::list<String> configFileLinesStaticReference = std::list<String>();
     844        static std::list<std::string> configFileLinesStaticReference = std::list<std::string>();
    845845        return configFileLinesStaticReference;
    846846    }
     
    866866        @param filename The name of the config-file
    867867    */
    868     void ConfigValueContainer::readConfigFile(const String& filename)
     868    void ConfigValueContainer::readConfigFile(const std::string& filename)
    869869    {
    870870        // This creates the file if it's not existing
     
    913913        @param filename The name of the config-file
    914914    */
    915     void ConfigValueContainer::writeConfigFile(const String& filename)
     915    void ConfigValueContainer::writeConfigFile(const std::string& filename)
    916916    {
    917917        // Make sure we stored the config-file in the list
     
    930930
    931931        // Iterate through the list an write the lines into the file
    932         std::list<String>::iterator it;
     932        std::list<std::string>::iterator it;
    933933        for (it = ConfigValueContainer::getConfigFileLines().begin(); it != ConfigValueContainer::getConfigFileLines().end(); ++it)
    934934        {
     
    943943        @param description The description
    944944    */
    945     void ConfigValueContainer::description(const String& description)
     945    void ConfigValueContainer::description(const std::string& description)
    946946    {
    947947        if (!this->bAddedDescription_)
    948948        {
    949             this->description_ = String("ConfigValueDescription::" + this->classname_ + "::" + this->varname_);
     949            this->description_ = std::string("ConfigValueDescription::" + this->classname_ + "::" + this->varname_);
    950950            Language::getLanguage().addEntry(description_, description);
    951951            this->bAddedDescription_ = true;
Note: See TracChangeset for help on using the changeset viewer.