mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 05:37:53 +08:00
modify Assets.loadStrings, strings file can be nnywhere in pak
This commit is contained in:
parent
272733716b
commit
606e073325
@ -297,10 +297,16 @@ std::unique_ptr<std::istream> Assets::getInputStream(const std::string&fullresid
|
||||
}
|
||||
|
||||
void Assets::loadStrings(const std::string&lan) {
|
||||
const std::string suffix = "/strings-"+lan+".xml";
|
||||
for(auto a:mResources) {
|
||||
const std::string fname = "strings/strings-"+lan+".xml";
|
||||
loadKeyValues(fname,nullptr,std::bind(&Assets::parseItem,this,a.first,fname,std::placeholders::_1,
|
||||
std::placeholders::_2,std::placeholders::_3,std::placeholders::_4));
|
||||
std::vector<std::string>files;
|
||||
a.second->getEntries(files);
|
||||
for(auto fileName:files){
|
||||
if( (TextUtils::endWith(fileName,".xml") && TextUtils::endWith(fileName,suffix) )==false)continue;
|
||||
loadKeyValues(fileName,nullptr,std::bind(&Assets::parseItem,this,a.first,fileName,std::placeholders::_1,
|
||||
std::placeholders::_2,std::placeholders::_3,std::placeholders::_4));
|
||||
LOGD("load %s for '%s'",fileName.c_str(),lan.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user