mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Fix bug in StringEngine
This commit is contained in:
parent
b6ecc0f856
commit
26beb30f77
|
@ -1967,6 +1967,7 @@ namespace MiniEngine
|
|||
{
|
||||
pimpl=new impl;
|
||||
pimpl->status=false;
|
||||
|
||||
std::ifstream ifs(StringFile);
|
||||
if(!ifs) return;
|
||||
rapidxml::file<> strFile(ifs);
|
||||
|
@ -1999,9 +2000,11 @@ namespace MiniEngine
|
|||
|
||||
std::string StringEngine::getString(std::string Tag)
|
||||
{
|
||||
if(!ready()) return "";
|
||||
char* context=pimpl->root->first_node(Tag.c_str())->value();
|
||||
if(context==nullptr) return "";
|
||||
if(!ready()) return "(StringEngine::STRING_NOT_FOUND)";
|
||||
rapidxml::xml_node<>* pnode=pimpl->root->first_node(Tag.c_str());
|
||||
if(pnode==nullptr) return "(StringEngine::STRING_NOT_FOUND)";
|
||||
char* context=pnode->value();
|
||||
if(context==nullptr) return "";/// Empty String.
|
||||
else return std::string(context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user