OpenCV  3.2.0-dev
Open Source Computer Vision
cv::FileNodeIterator Class Reference

used to iterate through sequences and mappings. More...

#include "persistence.hpp"

Collaboration diagram for cv::FileNodeIterator:

Classes

struct  SeqReader
 

Public Member Functions

 FileNodeIterator ()
 The constructors. More...
 
 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. More...
 
 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. More...
 
FileNode operator* () const
 returns the currently observed element More...
 
FileNodeIteratoroperator++ ()
 moves iterator to the next node More...
 
FileNodeIterator operator++ (int)
 moves iterator to the next node More...
 
FileNodeIteratoroperator+= (int ofs)
 moves iterator forward by the specified offset (possibly negative) More...
 
FileNodeIteratoroperator-- ()
 moves iterator to the previous node More...
 
FileNodeIterator operator-- (int)
 moves iterator to the previous node More...
 
FileNodeIteratoroperator-= (int ofs)
 moves iterator backward by the specified offset (possibly negative) More...
 
FileNode operator-> () const
 accesses the currently observed element methods More...
 
FileNodeIteratorreadRaw (const String &fmt, uchar *vec, size_t maxCount=(size_t) INT_MAX)
 Reads node elements to the buffer with the specified format. More...
 

Public Attributes

const CvFileNodecontainer
 
const CvFileStoragefs
 
SeqReader reader
 
size_t remaining
 

Related Functions

(Note that these are not member functions.)

void cvStartWriteRawData_Base64 (::CvFileStorage *fs, const char *name, int len, const char *dt)
 
template<typename _Tp >
static FileNodeIteratoroperator>> (FileNodeIterator &it, _Tp &value)
 Reads data from a file storage. More...
 
template<typename _Tp >
static FileNodeIteratoroperator>> (FileNodeIterator &it, std::vector< _Tp > &vec)
 Reads data from a file storage. More...
 
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)
 

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:
filestorage.cpp.

Constructor & Destructor Documentation

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.

cv::FileNodeIterator::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
fsFile storage for the iterator.
nodeFile node for the iterator.
ofsIndex of the element in the node. The created iterator will point to this element.
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
itIterator to be used as initialization for the created iterator.

Member Function Documentation

FileNode cv::FileNodeIterator::operator* ( ) const

returns the currently observed element

Referenced by operator<().

Here is the caller graph for this function:

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

moves iterator to the next node

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

moves iterator to the next node

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

moves iterator forward by the specified offset (possibly negative)

FileNodeIterator& cv::FileNodeIterator::operator-- ( )

moves iterator to the previous node

FileNodeIterator cv::FileNodeIterator::operator-- ( int  )

moves iterator to the previous node

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

moves iterator backward by the specified offset (possibly negative)

FileNode cv::FileNodeIterator::operator-> ( ) const

accesses the currently observed element methods

Referenced by operator<().

Here is the caller graph for this function:

FileNodeIterator& cv::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
fmtSpecification of each array element. See format specification
vecPointer to the destination array.
maxCountNumber of elements to read. If it is greater than number of remaining elements then all of them will be read.

Friends And Related Function Documentation

void cvStartWriteRawData_Base64 ( ::CvFileStorage fs,
const char *  name,
int  len,
const char *  dt 
)
related
static bool operator!= ( const FileNodeIterator it1,
const FileNodeIterator it2 
)
related
static ptrdiff_t operator- ( const FileNodeIterator it1,
const FileNodeIterator it2 
)
related

References remaining.

static bool operator== ( const FileNodeIterator it1,
const FileNodeIterator it2 
)
related
template<typename _Tp >
static FileNodeIterator & operator>> ( FileNodeIterator it,
_Tp &  value 
)
related

Reads data from a file storage.

template<typename _Tp >
static FileNodeIterator & operator>> ( FileNodeIterator it,
std::vector< _Tp > &  vec 
)
related

Reads data from a file storage.

Member Data Documentation

const CvFileNode* cv::FileNodeIterator::container

Referenced by operator==().

const CvFileStorage* cv::FileNodeIterator::fs

Referenced by operator==().

SeqReader cv::FileNodeIterator::reader

Referenced by operator==().

size_t cv::FileNodeIterator::remaining

Referenced by operator-(), operator<(), and operator==().


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