MCPcopy Create free account
hub / github.com/creatale/node-dv / icvFSCreateCollection

Function icvFSCreateCollection

deps/opencv/modules/core/src/persistence.cpp:431–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429
430
431static void
432icvFSCreateCollection( CvFileStorage* fs, int tag, CvFileNode* collection )
433{
434 if( CV_NODE_IS_MAP(tag) )
435 {
436 if( collection->tag != CV_NODE_NONE )
437 {
438 assert( fs->fmt == CV_STORAGE_FORMAT_XML );
439 CV_PARSE_ERROR( "Sequence element should not have name (use <_></_>)" );
440 }
441
442 collection->data.map = cvCreateMap( 0, sizeof(CvFileNodeHash),
443 sizeof(CvFileMapNode), fs->memstorage, 16 );
444 }
445 else
446 {
447 CvSeq* seq;
448 seq = cvCreateSeq( 0, sizeof(CvSeq), sizeof(CvFileNode), fs->memstorage );
449
450 // if <collection> contains some scalar element, add it to the newly created collection
451 if( CV_NODE_TYPE(collection->tag) != CV_NODE_NONE )
452 cvSeqPush( seq, collection );
453
454 collection->data.seq = seq;
455 }
456
457 collection->tag = tag;
458 cvSetSeqBlockSize( collection->data.seq, 8 );
459}
460
461
462/*static void

Callers 2

icvYMLParseValueFunction · 0.85
icvXMLParseValueFunction · 0.85

Calls 4

cvCreateMapFunction · 0.85
cvCreateSeqFunction · 0.85
cvSeqPushFunction · 0.85
cvSetSeqBlockSizeFunction · 0.85

Tested by

no test coverage detected