Fixed reading of the user class from *.xml (ticket #840).
This commit is contained in:
@@ -2828,7 +2828,10 @@ FileNodeIterator& operator >> (FileNodeIterator& it, vector<_Tp>& vec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Tp> static inline void operator >> (const FileNode& n, _Tp& value)
|
template<typename _Tp> static inline void operator >> (const FileNode& n, _Tp& value)
|
||||||
{ FileNodeIterator it = n.begin(); it >> value; }
|
{ read( n, value, _Tp()); }
|
||||||
|
|
||||||
|
template<typename _Tp> static inline void operator >> (const FileNode& n, vector<_Tp>& vec)
|
||||||
|
{ FileNodeIterator it = n.begin(); it >> vec; }
|
||||||
|
|
||||||
static inline bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2)
|
static inline bool operator == (const FileNodeIterator& it1, const FileNodeIterator& it2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void read(const FileNode& node, MyData& x, const MyData& default_value = MyData(
|
|||||||
if(node.empty())
|
if(node.empty())
|
||||||
x = default_value;
|
x = default_value;
|
||||||
else
|
else
|
||||||
x = (MyData)node;
|
x.read(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
ostream& operator<<(ostream& out, const MyData& m){
|
ostream& operator<<(ostream& out, const MyData& m){
|
||||||
|
|||||||
Reference in New Issue
Block a user