Class cv::FileNodeIterator#

used to iterate through sequences and mappings. View details

Collaboration diagram for cv::FileNodeIterator:

Detailed Description#

used to iterate through sequences and mappings.

A standard STL notation, with node.begin(), node.end() denoting the beginning and the end of a sequence, stored in node. See the data reading sample in the beginning of the section.

Examples
samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp, and samples/dnn/classification.cpp.

Constructor & Destructor Documentation#

FileNodeIterator()#

cv::FileNodeIterator::FileNodeIterator()

The constructors.

These constructors are used to create a default iterator, set it to specific element in a file node or construct it from another iterator.

FileNodeIterator()#

cv::FileNodeIterator::FileNodeIterator(
const FileNode & node,
bool seekEnd )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • node — File node - the collection to iterate over; it can be a scalar (equivalent to 1-element collection) or “none” (equivalent to empty collection).

  • seekEnd — - true if iterator needs to be set after the last element of the node; that is: node.begin() => FileNodeIterator(node, false) node.end() => FileNodeIterator(node, true)

FileNodeIterator()#

cv::FileNodeIterator::FileNodeIterator(const FileNodeIterator & it)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters

  • it — Iterator to be used as initialization for the created iterator.

Member Function Documentation#

equalTo()#

bool cv::FileNodeIterator::equalTo(const FileNodeIterator & it)

operator*()#

FileNode cv::FileNodeIterator::operator*()

returns the currently observed element

operator++()#

FileNodeIterator & cv::FileNodeIterator::operator++()

moves iterator to the next node

operator++()#

FileNodeIterator cv::FileNodeIterator::operator++(int)

moves iterator to the next node

operator+=()#

FileNodeIterator & cv::FileNodeIterator::operator+=(int ofs)

moves iterator forward by the specified offset (possibly negative)

operator=()#

FileNodeIterator & cv::FileNodeIterator::operator=(const FileNodeIterator & it)

readRaw()#

FileNodeIterator & cv::FileNodeIterator::readRaw(
const String & fmt,
void * vec,
size_t len = (size_t) INT_MAX )

Reads node elements to the buffer with the specified format.

Usually it is more convenient to use operator >> instead of this method.

Parameters

  • fmt — Specification of each array element. See format specification

  • vec — Pointer to the destination array.

  • len — Number of bytes to read (buffer size limit). If it is greater than number of remaining elements then all of them will be read.

remaining()#

size_t cv::FileNodeIterator::remaining()

returns the number of remaining (not read yet) elements

Member Data Documentation#

blockIdx#

size_t cv::FileNodeIterator::blockIdx

blockSize#

size_t cv::FileNodeIterator::blockSize

fs#

FileStorage::Impl * cv::FileNodeIterator::fs

idx#

size_t cv::FileNodeIterator::idx

nodeNElems#

size_t cv::FileNodeIterator::nodeNElems

ofs#

size_t cv::FileNodeIterator::ofs

Source file#

The documentation for this class was generated from the following file: