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

This commit is contained in:
Koji Miyazato 2014-03-13 19:41:13 +09:00
parent 70e22b682d
commit b96762a48f

View File

@ -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)
{ {