Merge pull request #6314 from mvukad:bugfix_dtreeswrite

This commit is contained in:
Maksim Shabunin
2016-04-12 13:26:25 +00:00
33 changed files with 47 additions and 1 deletions

View File

@@ -3067,6 +3067,9 @@ public:
/** Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string. */
CV_WRAP virtual String getDefaultName() const;
protected:
void writeFormat(FileStorage& fs) const;
};
struct Param {

View File

@@ -57,7 +57,6 @@ void Algorithm::save(const String& filename) const
{
FileStorage fs(filename, FileStorage::WRITE);
fs << getDefaultName() << "{";
fs << "format" << (int)3;
write(fs);
fs << "}";
}
@@ -67,6 +66,11 @@ String Algorithm::getDefaultName() const
return String("my_object");
}
void Algorithm::writeFormat(FileStorage& fs) const
{
fs << "format" << (int)3;
}
}
/* End of file. */