1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #22934 from alalek:fix_filestorage_binding

This commit is contained in:
Alexander Alekhin
2022-12-17 03:28:13 +00:00
4 changed files with 46 additions and 12 deletions
+13 -5
View File
@@ -55,19 +55,27 @@ Algorithm::~Algorithm()
CV_TRACE_FUNCTION();
}
void Algorithm::write(const Ptr<FileStorage>& fs, const String& name) const
void Algorithm::write(FileStorage& fs, const String& name) const
{
CV_TRACE_FUNCTION();
if(name.empty())
{
write(*fs);
write(fs);
return;
}
*fs << name << "{";
write(*fs);
*fs << "}";
fs << name << "{";
write(fs);
fs << "}";
}
#if CV_VERSION_MAJOR < 5
void Algorithm::write(const Ptr<FileStorage>& fs, const String& name) const
{
CV_Assert(fs);
write(*fs, name);
}
#endif
void Algorithm::save(const String& filename) const
{
CV_TRACE_FUNCTION();