FileStorage: add simplified API for bindings

at least it is possible to read/ write calibration files. Fixes #4282.

Also add CPP method for writing comments.
This commit is contained in:
Pavel Rojtberg
2016-04-27 16:59:26 +02:00
parent 6e5e5d87df
commit bf688da50b
2 changed files with 53 additions and 3 deletions
+19
View File
@@ -5271,6 +5271,25 @@ void FileStorage::writeObj( const String& name, const void* obj )
cvWrite( fs, name.size() > 0 ? name.c_str() : 0, obj );
}
void FileStorage::write( const String& name, double val )
{
*this << name << val;
}
void FileStorage::write( const String& name, const String& val )
{
*this << name << val;
}
void FileStorage::write( const String& name, InputArray val )
{
*this << name << val.getMat();
}
void FileStorage::writeComment( const String& comment, bool append )
{
cvWriteComment(fs, comment.c_str(), append ? 1 : 0);
}
FileNode FileStorage::operator[](const String& nodename) const
{