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

Function icvClose

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

Source from the content-addressed store, hash-verified

540
541
542static void
543icvClose( CvFileStorage* fs, std::string* out )
544{
545 if( out )
546 out->clear();
547
548 if( !fs )
549 CV_Error( CV_StsNullPtr, "NULL double pointer to file storage" );
550
551 if( fs->is_opened )
552 {
553 if( fs->write_mode && (fs->file || fs->gzfile || fs->outbuf) )
554 {
555 if( fs->write_stack )
556 {
557 while( fs->write_stack->total > 0 )
558 cvEndWriteStruct(fs);
559 }
560 icvFSFlush(fs);
561 if( fs->fmt == CV_STORAGE_FORMAT_XML )
562 icvPuts( fs, "</opencv_storage>\n" );
563 }
564
565 icvCloseFile(fs);
566 }
567
568 if( fs->outbuf && out )
569 {
570 out->resize(fs->outbuf->size());
571 std::copy(fs->outbuf->begin(), fs->outbuf->end(), out->begin());
572 }
573}
574
575
576/* closes file storage and deallocates buffers */

Callers 2

cvReleaseFileStorageFunction · 0.85
releaseAndGetStringMethod · 0.85

Calls 9

cvEndWriteStructFunction · 0.85
icvFSFlushFunction · 0.85
icvPutsFunction · 0.85
icvCloseFileFunction · 0.85
clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected