My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 #pragma once 00029 #include "Define.h" 00030 #include <vector> 00031 #include <string> 00032 #include <map> 00033 #include <algorithm> 00034 #include "SystemHelper.h" 00035 #include "PathHelper.h" 00036 #include "StringHelper.h" 00037 #include "Game.h" 00038 00039 namespace SallyAPI 00040 { 00041 namespace Config 00042 { 00043 #define MAX_LANGSTRING 10000 00044 00053 00054 class DLL_API_SALLY CLanguageManager 00055 { 00056 private: 00057 std::map<std::string, std::string> m_mCache; 00058 std::vector<std::string> m_vLangFileDirs; 00059 std::string m_strBaseDir; 00060 std::string m_strLang; 00061 std::string m_strFileExtention; 00062 public: 00063 CLanguageManager(const std::string& lang, const std::string& fileExtention); 00064 ~CLanguageManager(); 00065 00066 std::string GetString(const std::string& id); 00067 std::string GetString(const std::string& id, const char* first, ...); 00068 00069 void AddLangFileDir(const std::string& langFileDir); 00070 std::vector<std::string> GetLangFileDirs(); 00071 }; 00072 } 00073 }