Commit b96762a4 authored by Koji Miyazato's avatar Koji Miyazato

Fix for bug #3599: cv::FileStorage does not work for std::vector of user-defined struct.

parent 70e22b68
...@@ -697,11 +697,11 @@ void write(FileStorage& fs, const String& name, const Range& r ) ...@@ -697,11 +697,11 @@ void write(FileStorage& fs, const String& name, const Range& r )
template<typename _Tp> static inline template<typename _Tp> static inline
void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec ) void write( FileStorage& fs, const String& name, const std::vector<_Tp>& vec )
{ {
internal::WriteStructContext ws(fs, name, FileNode::SEQ+(DataType<_Tp>::fmt != 0 ? FileNode::FLOW : 0)); fs << (DataType<_Tp>::fmt != 0 ? "[:" : "[");
write(fs, vec); write(fs, vec);
fs << "]";
} }
static inline static inline
void read(const FileNode& node, bool& value, bool default_value) void read(const FileNode& node, bool& value, bool default_value)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment