class cv::FileNodeIterator
Overview
used to iterate through sequences and mappings. Moreā¦
#include <persistence.hpp> class FileNodeIterator { public: // structs struct SeqReader; // fields const CvFileNode* container; const CvFileStorage* fs; SeqReader reader; size_t remaining; // construction FileNodeIterator(); FileNodeIterator( const CvFileStorage* fs, const CvFileNode* node, size_t ofs = 0 ); FileNodeIterator(const FileNodeIterator& it); // methods template <typename _Tp> static FileNodeIterator& operator>>( FileNodeIterator& it, _Tp& value ); template <typename _Tp> static FileNodeIterator& operator>>( FileNodeIterator& it, std::vector<_Tp>& vec ); static bool operator==( const FileNodeIterator& it1, const FileNodeIterator& it2 ); static bool operator!=( const FileNodeIterator& it1, const FileNodeIterator& it2 ); static ptrdiff_t operator-( const FileNodeIterator& it1, const FileNodeIterator& it2 ); static bool operator<( const FileNodeIterator& it1, const FileNodeIterator& it2 ); FileNode operator*() const; FileNodeIterator& operator++(); FileNodeIterator operator++(int); FileNodeIterator& operator+=(int ofs); FileNodeIterator& operator--(); FileNodeIterator operator--(int); FileNodeIterator& operator-=(int ofs); FileNode operator->() const; FileNodeIterator& readRaw( const String& fmt, uchar* vec, size_t maxCount = (size_t) INT_MAX ); void cvStartWriteRawData_Base64( ::CvFileStorage* fs, const char* name, int len, const char* dt ); };
Detailed Documentation
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.
Construction
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( const CvFileStorage* fs, const CvFileNode* node, size_t ofs = 0 )
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Parameters:
fs | File storage for the iterator. |
node | File node for the iterator. |
ofs | Index of the element in the node. The created iterator will point to this element. |
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. |
Methods
template <typename _Tp> static FileNodeIterator& operator>>( FileNodeIterator& it, _Tp& value )
Reads data from a file storage.
template <typename _Tp> static FileNodeIterator& operator>>( FileNodeIterator& it, std::vector<_Tp>& vec )
Reads data from a file storage.
FileNode operator*() const
returns the currently observed element
FileNodeIterator& operator++()
moves iterator to the next node
FileNodeIterator operator++(int)
moves iterator to the next node
FileNodeIterator& operator+=(int ofs)
moves iterator forward by the specified offset (possibly negative)
FileNodeIterator& operator--()
moves iterator to the previous node
FileNodeIterator operator--(int)
moves iterator to the previous node
FileNodeIterator& operator-=(int ofs)
moves iterator backward by the specified offset (possibly negative)
FileNode operator->() const
accesses the currently observed element methods
FileNodeIterator& readRaw( const String& fmt, uchar* vec, size_t maxCount = (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. |
maxCount | Number of elements to read. If it is greater than number of remaining elements then all of them will be read. |