Changeset 728 for code/branches/FICN/src/orxonox/core
- Timestamp:
- Dec 30, 2007, 6:56:58 PM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/CorePrereqs.h
r708 r728 27 27 28 28 /** 29 @file OrxonoxPrereq. cc29 @file OrxonoxPrereq.h 30 30 @brief Contains all the necessary forward declarations for all classes, structs and enums. 31 31 */ -
code/branches/FICN/src/orxonox/core/Language.cc
r725 r728 142 142 143 143 // Make sure we don't create a duplicate entry 144 if ( !it->second)144 if (it == this->languageEntries_.end()) 145 145 { 146 146 LanguageEntry* newEntry = new LanguageEntry(entry); … … 161 161 void Language::addEntry(const LanguageEntryName& name, const std::string& entry) 162 162 { 163 COUT(5) << "Called addEntry with\n name: " << name << "\n entry: " << entry << std::endl; 163 164 std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name); 164 if ( !it->second)165 if (it == this->languageEntries_.end()) 165 166 { 166 167 // The entry isn't available yet, meaning it's new, so create it … … 180 181 // Write the default language file because either a new entry was created or an existing entry has changed 181 182 this->writeDefaultLanguageFile(); 183 182 184 } 183 185 … … 190 192 { 191 193 std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.find(name); 192 if (it ->second)194 if (it != this->languageEntries_.end()) 193 195 return it->second->getTranslation(); 194 196 else … … 294 296 295 297 // Check if the entry exists 296 if (it ->second)298 if (it != this->languageEntries_.end()) 297 299 it->second->setTranslation(lineString.substr(pos + 1)); 298 300 else -
code/branches/FICN/src/orxonox/core/Language.h
r725 r728 63 63 void setDefault(const std::string& fallbackEntry); 64 64 65 /** @brief Returns the translated entry in the configured language. @return The translated entry */ 65 /** 66 @brief Returns the translated entry in the configured language. 67 @return The translated entry 68 */ 66 69 inline const std::string& getTranslation() 67 70 { return this->translatedEntry_; } 68 71 69 /** @brief Returns the default entry. @return The default entry */ 72 /** 73 @brief Returns the default entry. 74 @return The default entry 75 */ 70 76 inline const std::string& getDefault() 71 77 { return this->fallbackEntry_; }
Note: See TracChangeset
for help on using the changeset viewer.