Merge pull request #12641 from dkurt:dnn_samples_args_autofill

This commit is contained in:
Alexander Alekhin
2018-10-13 12:28:08 +00:00
12 changed files with 435 additions and 104 deletions
@@ -542,6 +542,11 @@ public:
*/
CV_WRAP_AS(at) FileNode operator[](int i) const;
/** @brief Returns keys of a mapping node.
@returns Keys of a mapping node.
*/
CV_WRAP std::vector<String> keys() const;
/** @brief Returns type of the node.
@returns Type of the node. See FileNode::Type
*/
+14
View File
@@ -269,6 +269,20 @@ FileNode FileNode::operator[](int i) const
i == 0 ? *this : FileNode();
}
std::vector<String> FileNode::keys() const
{
std::vector<String> res;
if (isMap())
{
res.reserve(size());
for (FileNodeIterator it = begin(); it != end(); ++it)
{
res.push_back((*it).name());
}
}
return res;
}
String FileNode::name() const
{
const char* str;