| 429 | |
| 430 | |
| 431 | static void |
| 432 | icvFSCreateCollection( 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 |
no test coverage detected