Changeset 708 for code/branches/FICN/src/orxonox/core/Language.h
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/Language.h
r704 r708 29 29 #define _Language_H__ 30 30 31 #include <string>32 31 #include <map> 33 32 34 33 #include "CorePrereqs.h" 35 34 35 #include "misc/String.h" 36 36 #include "OrxonoxClass.h" 37 37 38 38 namespace orxonox 39 39 { 40 typedef std::string LanguageEntryName;40 typedef String LanguageEntryName; 41 41 42 42 class _CoreExport LanguageEntry : public OrxonoxClass 43 43 { 44 44 public: 45 explicit LanguageEntry(const std::string& fallbackEntry);46 void setTranslation(const std::string& translation);47 void setDefault(const std::string& fallbackEntry);45 explicit LanguageEntry(const String& fallbackEntry); 46 void setTranslation(const String& translation); 47 void setDefault(const String& fallbackEntry); 48 48 49 inline const std::string& getTranslation()49 inline const String& getTranslation() 50 50 { return this->translatedEntry_; } 51 51 52 inline const std::string& getDefault()52 inline const String& getDefault() 53 53 { return this->fallbackEntry_; } 54 54 55 55 private: 56 std::string fallbackEntry_;57 std::string translatedEntry_;56 String fallbackEntry_; 57 String translatedEntry_; 58 58 }; 59 59 … … 63 63 static Language& getLanguage(); 64 64 void setConfigValues(); 65 void addEntry(const LanguageEntryName& name, const std::string& entry);66 const std::string& getTranslation(const LanguageEntryName& name) const;65 void addEntry(const LanguageEntryName& name, const String& entry); 66 const String& getTranslation(const LanguageEntryName& name) const; 67 67 68 68 private: … … 74 74 void readTranslatedLanguageFile(); 75 75 void writeDefaultLanguageFile() const; 76 static const std::string getFileName(const std::string& language);77 void createEntry(const LanguageEntryName& name, const std::string& entry);76 static const String getFileName(const String& language); 77 void createEntry(const LanguageEntryName& name, const String& entry); 78 78 79 std::string language_;80 std::string defaultLanguage_;81 std::string defaultTranslation_;82 std::map< std::string, LanguageEntry*> languageEntries_;79 String language_; 80 String defaultLanguage_; 81 String defaultTranslation_; 82 std::map<String, LanguageEntry*> languageEntries_; 83 83 }; 84 84 }
Note: See TracChangeset
for help on using the changeset viewer.