mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
core(persistence): fix processing of multiple documents
This commit is contained in:
@@ -1900,18 +1900,19 @@ int FileStorage::getFormat() const
|
||||
|
||||
FileNode FileStorage::operator [](const char* key) const
|
||||
{
|
||||
if( p->roots.empty() )
|
||||
return FileNode();
|
||||
|
||||
return p->roots[0][key];
|
||||
return this->operator[](std::string(key));
|
||||
}
|
||||
|
||||
FileNode FileStorage::operator [](const std::string& key) const
|
||||
{
|
||||
if( p->roots.empty() )
|
||||
return FileNode();
|
||||
|
||||
return p->roots[0][key];
|
||||
FileNode res;
|
||||
for (size_t i = 0; i < p->roots.size(); i++)
|
||||
{
|
||||
res = p->roots[i][key];
|
||||
if (!res.empty())
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
String FileStorage::releaseAndGetString()
|
||||
|
||||
Reference in New Issue
Block a user