cv::FileNode Class Reference

#include <core.hpp>

List of all members.

Public Types

enum  {
  NONE = 0, INT = 1, REAL = 2, FLOAT = REAL,
  STR = 3, STRING = STR, REF = 4, SEQ = 5,
  MAP = 6, TYPE_MASK = 7, FLOW = 8, USER = 16,
  EMPTY = 32, NAMED = 64
}
 

type of the file storage node

More...

Public Member Functions

FileNodeIterator begin () const
 returns iterator pointing to the first node element
CV_WRAP bool empty () const
 returns true if the node is empty
FileNodeIterator end () const
 returns iterator pointing to the element following the last node element
 FileNode (const FileNode &node)
 the copy constructor
 FileNode (const CvFileStorage *fs, const CvFileNode *node)
 the full constructor wrapping CvFileNode structure.
CV_WRAP FileNode ()
 the default constructor
CV_WRAP bool isInt () const
 returns true if the node is an integer
CV_WRAP bool isMap () const
 returns true if the node is a mapping
CV_WRAP bool isNamed () const
 returns true if the node has a name
CV_WRAP bool isNone () const
 returns true if the node is a "none" object
CV_WRAP bool isReal () const
 returns true if the node is a floating-point number
CV_WRAP bool isSeq () const
 returns true if the node is a sequence
CV_WRAP bool isString () const
 returns true if the node is a text string
CV_WRAP string name () const
 returns the node name or an empty string if the node is nameless
 operator double () const
 returns the node content as double
 operator float () const
 returns the node content as float
 operator int () const
 returns the node content as an integer. If the node stores floating-point number, it is rounded.
 operator string () const
 returns the node content as text string
const CvFileNodeoperator* () const
 returns pointer to the underlying file node
CvFileNodeoperator* ()
 returns pointer to the underlying file node
CV_WRAP FileNode operator[] (int i) const
 returns element of a sequence node
CV_WRAP FileNode operator[] (const char *nodename) const
 returns element of a mapping node
FileNode operator[] (const string &nodename) const
 returns element of a mapping node
void * readObj () const
 reads the registered object and returns pointer to it
void readRaw (const string &fmt, uchar *vec, size_t len) const
 reads node elements to the buffer with the specified format
CV_WRAP size_t size () const
 returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.
CV_WRAP int type () const
 returns type of the node

Public Attributes

const CvFileStoragefs
const CvFileNodenode

Detailed Description

File Storage Node class

The node is used to store each and every element of the file storage opened for reading - from the primitive objects, such as numbers and text strings, to the complex nodes: sequences, mappings and the registered objects.

Note that file nodes are only used for navigating file storages opened for reading. When a file storage is opened for writing, no data is stored in memory after it is written.


Member Enumeration Documentation

anonymous enum

type of the file storage node

Enumerator:
NONE 

empty node

INT 

an integer

REAL 

floating-point number

FLOAT 

synonym or REAL

STR 

text string in UTF-8 encoding

STRING 

synonym for STR

REF 

integer of size size_t. Typically used for storing complex dynamic structures where some elements reference the others

SEQ 

sequence

MAP 

mapping

TYPE_MASK 
FLOW 

compact representation of a sequence or mapping. Used only by YAML writer

USER 

a registered object (e.g. a matrix)

EMPTY 

empty structure (sequence or mapping)

NAMED 

the node has a name (i.e. it is element of a mapping)


Constructor & Destructor Documentation

cv::FileNode::FileNode (  )  [inline]

the default constructor

cv::FileNode::FileNode ( const CvFileStorage fs,
const CvFileNode node 
) [inline]

the full constructor wrapping CvFileNode structure.

cv::FileNode::FileNode ( const FileNode node  )  [inline]

the copy constructor


Member Function Documentation

FileNodeIterator cv::FileNode::begin (  )  const [inline]

returns iterator pointing to the first node element

bool cv::FileNode::empty (  )  const [inline]

returns true if the node is empty

FileNodeIterator cv::FileNode::end (  )  const [inline]

returns iterator pointing to the element following the last node element

bool cv::FileNode::isInt (  )  const [inline]

returns true if the node is an integer

bool cv::FileNode::isMap (  )  const [inline]

returns true if the node is a mapping

bool cv::FileNode::isNamed (  )  const [inline]

returns true if the node has a name

bool cv::FileNode::isNone (  )  const [inline]

returns true if the node is a "none" object

bool cv::FileNode::isReal (  )  const [inline]

returns true if the node is a floating-point number

bool cv::FileNode::isSeq (  )  const [inline]

returns true if the node is a sequence

bool cv::FileNode::isString (  )  const [inline]

returns true if the node is a text string

CV_WRAP string cv::FileNode::name (  )  const

returns the node name or an empty string if the node is nameless

cv::FileNode::operator double (  )  const [inline]

returns the node content as double

cv::FileNode::operator float (  )  const [inline]

returns the node content as float

cv::FileNode::operator int (  )  const [inline]

returns the node content as an integer. If the node stores floating-point number, it is rounded.

cv::FileNode::operator string (  )  const [inline]

returns the node content as text string

const CvFileNode * cv::FileNode::operator* (  )  const [inline]

returns pointer to the underlying file node

CvFileNode * cv::FileNode::operator* (  )  [inline]

returns pointer to the underlying file node

CV_WRAP FileNode cv::FileNode::operator[] ( int  i  )  const

returns element of a sequence node

CV_WRAP FileNode cv::FileNode::operator[] ( const char *  nodename  )  const

returns element of a mapping node

FileNode cv::FileNode::operator[] ( const string &  nodename  )  const

returns element of a mapping node

void* cv::FileNode::readObj (  )  const

reads the registered object and returns pointer to it

void cv::FileNode::readRaw ( const string &  fmt,
uchar vec,
size_t  len 
) const [inline]

reads node elements to the buffer with the specified format

size_t cv::FileNode::size (  )  const [inline]

returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.

int cv::FileNode::type (  )  const [inline]

returns type of the node


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Thu Dec 23 11:40:55 2010 for opencv by  doxygen 1.6.3