diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 6d8ad20c14..5103c7df8b 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -438,6 +438,8 @@ public: * @param name Name of the written object * @param val Value of the written object */ + CV_WRAP void write(const String& name, int val); + /// @overload CV_WRAP void write(const String& name, double val); /// @overload CV_WRAP void write(const String& name, const String& val); diff --git a/modules/core/src/persistence_cpp.cpp b/modules/core/src/persistence_cpp.cpp index 4c3ec44e78..9b1e6bd82d 100644 --- a/modules/core/src/persistence_cpp.cpp +++ b/modules/core/src/persistence_cpp.cpp @@ -178,6 +178,12 @@ 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, int val ) +{ + *this << name << val; +} + void FileStorage::write( const String& name, double val ) { *this << name << val;