Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2009, 9:22:22 PM (14 years ago)
Author:
rgrieder
Message:

Synchronised sandbox with current code trunk. There should be a few bug fixes.

Location:
sandbox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox

  • sandbox/src/libraries/core/ConfigFileManager.cc

    r5782 r6038  
    3535#include "util/StringUtils.h"
    3636#include "ConfigValueContainer.h"
    37 #include "Core.h"
     37#include "PathConfig.h"
    3838
    3939namespace orxonox
     
    4141    bool config(const std::string& classname, const std::string& varname, const std::string& value)
    4242    {
    43         std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
    44         if (identifier != Identifier::getLowercaseIdentifierMapEnd())
     43        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseStringIdentifierMap().find(getLowercase(classname));
     44        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
    4545        {
    4646            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
     
    5353    bool tconfig(const std::string& classname, const std::string& varname, const std::string& value)
    5454    {
    55         std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseIdentifierMap().find(getLowercase(classname));
    56         if (identifier != Identifier::getLowercaseIdentifierMapEnd())
     55        std::map<std::string, Identifier*>::const_iterator identifier = Identifier::getLowercaseStringIdentifierMap().find(getLowercase(classname));
     56        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
    5757        {
    5858            std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
     
    215215
    216216        // Get default file if necessary and available
    217         boost::filesystem::path filepath(Core::getConfigPath() / this->filename_);
     217        boost::filesystem::path filepath(PathConfig::getConfigPath() / this->filename_);
    218218        if (!boost::filesystem::exists(filepath))
    219219        {
    220220            // Try to get default one from the data folder
    221             boost::filesystem::path defaultFilepath(Core::getDataPath() / "defaultConfig" / this->filename_);
     221            boost::filesystem::path defaultFilepath(PathConfig::getDataPath() / "defaultConfig" / this->filename_);
    222222            if (boost::filesystem::exists(defaultFilepath))
    223223            {
     
    329329    {
    330330        std::ofstream file;
    331         file.open((Core::getConfigPathString() + filename_).c_str(), std::fstream::out);
     331        file.open((PathConfig::getConfigPathString() + filename_).c_str(), std::fstream::out);
    332332        file.setf(std::ios::fixed, std::ios::floatfield);
    333333        file.precision(6);
     
    369369        for (std::list<ConfigFileSection*>::iterator it1 = this->sections_.begin(); it1 != this->sections_.end(); )
    370370        {
    371             std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getIdentifierMap().find((*it1)->getName());
    372             if (it2 != Identifier::getIdentifierMapEnd() && (*it2).second->hasConfigValues())
     371            std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getStringIdentifierMap().find((*it1)->getName());
     372            if (it2 != Identifier::getStringIdentifierMapEnd() && (*it2).second->hasConfigValues())
    373373            {
    374374                // The section exists, delete comment
     
    448448        if (this->type_ == ConfigFileType::Settings)
    449449        {
    450             for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getIdentifierMapBegin(); it != Identifier::getIdentifierMapEnd(); ++it)
     450            for (std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapBegin(); it != Identifier::getStringIdentifierMapEnd(); ++it)
    451451            {
    452452                if (it->second->hasConfigValues())
Note: See TracChangeset for help on using the changeset viewer.