compatibility: keep Ptr<FileStorage> stubs till OpenCV 5.0

pull/22934/head
Alexander Alekhin 2 years ago
parent 6a8c5a1d27
commit 6e3700593f
  1. 4
      modules/core/include/opencv2/core.hpp
  2. 8
      modules/core/src/algorithm.cpp
  3. 6
      modules/features2d/include/opencv2/features2d.hpp

@ -3101,6 +3101,10 @@ public:
* @overload * @overload
*/ */
CV_WRAP void write(FileStorage& fs, const String& name) const; CV_WRAP void write(FileStorage& fs, const String& name) const;
#if CV_VERSION_MAJOR < 5
/** @deprecated */
void write(const Ptr<FileStorage>& fs, const String& name = String()) const;
#endif
/** @brief Reads algorithm parameters from a file storage /** @brief Reads algorithm parameters from a file storage
*/ */

@ -68,6 +68,14 @@ void Algorithm::write(FileStorage& fs, const String& name) const
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 void Algorithm::save(const String& filename) const
{ {
CV_TRACE_FUNCTION(); CV_TRACE_FUNCTION();

@ -213,6 +213,9 @@ public:
// see corresponding cv::Algorithm method // see corresponding cv::Algorithm method
CV_WRAP inline void write(FileStorage& fs, const String& name) const { Algorithm::write(fs, name); } CV_WRAP inline void write(FileStorage& fs, const String& name) const { Algorithm::write(fs, name); }
#if CV_VERSION_MAJOR < 5
inline void write(const Ptr<FileStorage>& fs, const String& name) const { CV_Assert(fs); Algorithm::write(*fs, name); }
#endif
}; };
/** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch /** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch
@ -1102,6 +1105,9 @@ public:
// see corresponding cv::Algorithm method // see corresponding cv::Algorithm method
CV_WRAP inline void write(FileStorage& fs, const String& name) const { Algorithm::write(fs, name); } CV_WRAP inline void write(FileStorage& fs, const String& name) const { Algorithm::write(fs, name); }
#if CV_VERSION_MAJOR < 5
inline void write(const Ptr<FileStorage>& fs, const String& name) const { CV_Assert(fs); Algorithm::write(*fs, name); }
#endif
protected: protected:
/** /**

Loading…
Cancel
Save