mirror of
https://github.com/opencv/opencv.git
synced 2024-12-03 00:10:21 +08:00
Merge pull request #13292 from mshabunin:fix-filenode-compat
This commit is contained in:
commit
21bb17e3ee
@ -565,7 +565,7 @@ public:
|
|||||||
//! returns the node content as double
|
//! returns the node content as double
|
||||||
operator double() const;
|
operator double() const;
|
||||||
//! returns the node content as text string
|
//! returns the node content as text string
|
||||||
operator std::string() const;
|
inline operator std::string() const { return this->string(); }
|
||||||
|
|
||||||
static bool isMap(int flags);
|
static bool isMap(int flags);
|
||||||
static bool isSeq(int flags);
|
static bool isSeq(int flags);
|
||||||
@ -599,7 +599,7 @@ public:
|
|||||||
//! Simplified reading API to use with bindings.
|
//! Simplified reading API to use with bindings.
|
||||||
CV_WRAP double real() const;
|
CV_WRAP double real() const;
|
||||||
//! Simplified reading API to use with bindings.
|
//! Simplified reading API to use with bindings.
|
||||||
CV_WRAP String string() const;
|
CV_WRAP std::string string() const;
|
||||||
//! Simplified reading API to use with bindings.
|
//! Simplified reading API to use with bindings.
|
||||||
CV_WRAP Mat mat() const;
|
CV_WRAP Mat mat() const;
|
||||||
|
|
||||||
|
@ -2197,7 +2197,8 @@ FileNode::operator double() const
|
|||||||
return DBL_MAX;
|
return DBL_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileNode::operator std::string() const
|
double FileNode::real() const { return double(*this); }
|
||||||
|
std::string FileNode::string() const
|
||||||
{
|
{
|
||||||
const uchar* p = ptr();
|
const uchar* p = ptr();
|
||||||
if( !p || (*p & TYPE_MASK) != STRING )
|
if( !p || (*p & TYPE_MASK) != STRING )
|
||||||
@ -2206,9 +2207,6 @@ FileNode::operator std::string() const
|
|||||||
size_t sz = (size_t)(unsigned)readInt(p);
|
size_t sz = (size_t)(unsigned)readInt(p);
|
||||||
return std::string((const char*)(p + 4), sz - 1);
|
return std::string((const char*)(p + 4), sz - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
double FileNode::real() const { return double(*this); }
|
|
||||||
std::string FileNode::string() const { return std::string(*this); }
|
|
||||||
Mat FileNode::mat() const { Mat value; read(*this, value, Mat()); return value; }
|
Mat FileNode::mat() const { Mat value; read(*this, value, Mat()); return value; }
|
||||||
|
|
||||||
FileNodeIterator FileNode::begin() const { return FileNodeIterator(*this, false); }
|
FileNodeIterator FileNode::begin() const { return FileNodeIterator(*this, false); }
|
||||||
|
Loading…
Reference in New Issue
Block a user