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

Function icvXMLStartWriteStruct

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

Source from the content-addressed store, hash-verified

2387
2388
2389static void
2390icvXMLStartWriteStruct( CvFileStorage* fs, const char* key, int struct_flags,
2391 const char* type_name CV_DEFAULT(0))
2392{
2393 CvXMLStackRecord parent;
2394 const char* attr[10];
2395 int idx = 0;
2396
2397 struct_flags = (struct_flags & (CV_NODE_TYPE_MASK|CV_NODE_FLOW)) | CV_NODE_EMPTY;
2398 if( !CV_NODE_IS_COLLECTION(struct_flags))
2399 CV_Error( CV_StsBadArg,
2400 "Some collection type: CV_NODE_SEQ or CV_NODE_MAP must be specified" );
2401
2402 if( type_name )
2403 {
2404 attr[idx++] = "type_id";
2405 attr[idx++] = type_name;
2406 }
2407 attr[idx++] = 0;
2408
2409 icvXMLWriteTag( fs, key, CV_XML_OPENING_TAG, cvAttrList(attr,0) );
2410
2411 parent.struct_flags = fs->struct_flags & ~CV_NODE_EMPTY;
2412 parent.struct_indent = fs->struct_indent;
2413 parent.struct_tag = fs->struct_tag;
2414 cvSaveMemStoragePos( fs->strstorage, &parent.pos );
2415 cvSeqPush( fs->write_stack, &parent );
2416
2417 fs->struct_indent += CV_XML_INDENT;
2418 if( !CV_NODE_IS_FLOW(struct_flags) )
2419 icvXMLFlush( fs );
2420
2421 fs->struct_flags = struct_flags;
2422 if( key )
2423 {
2424 fs->struct_tag = cvMemStorageAllocString( fs->strstorage, (char*)key, -1 );
2425 }
2426 else
2427 {
2428 fs->struct_tag.ptr = 0;
2429 fs->struct_tag.len = 0;
2430 }
2431}
2432
2433
2434static void

Callers

nothing calls this directly

Calls 4

icvXMLWriteTagFunction · 0.85
cvSaveMemStoragePosFunction · 0.85
cvSeqPushFunction · 0.85
cvMemStorageAllocStringFunction · 0.85

Tested by

no test coverage detected