replaced "string FileStorage::release()" with 2 methods to preserve backward compatibility.

This commit is contained in:
Vadim Pisarevsky
2012-05-30 11:29:22 +00:00
parent 48c3cfdfd0
commit 74882fe188
3 changed files with 18 additions and 9 deletions

View File

@@ -5154,19 +5154,25 @@ bool FileStorage::isOpened() const
return !fs.empty() && fs.obj->is_opened;
}
string FileStorage::release()
void FileStorage::release()
{
string buf;
if( fs.obj && fs.obj->outbuf )
icvClose(fs.obj, &buf);
fs.release();
structs.clear();
state = UNDEFINED;
return buf;
}
void FileStorage::release(string& buf)
{
if( fs.obj && fs.obj->outbuf )
icvClose(fs.obj, &buf);
else
buf.clear();
fs.release();
structs.clear();
state = UNDEFINED;
}
FileNode FileStorage::root(int streamidx) const
{
return isOpened() ? FileNode(fs, cvGetRootFileNode(fs, streamidx)) : FileNode();