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

Function icvYMLParseKey

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

Source from the content-addressed store, hash-verified

1027
1028
1029static char*
1030icvYMLParseKey( CvFileStorage* fs, char* ptr,
1031 CvFileNode* map_node, CvFileNode** value_placeholder )
1032{
1033 char c;
1034 char *endptr = ptr - 1, *saveptr;
1035 CvStringHashNode* str_hash_node;
1036
1037 if( *ptr == '-' )
1038 CV_PARSE_ERROR( "Key may not start with \'-\'" );
1039
1040 do c = *++endptr;
1041 while( cv_isprint(c) && c != ':' );
1042
1043 if( c != ':' )
1044 CV_PARSE_ERROR( "Missing \':\'" );
1045
1046 saveptr = endptr + 1;
1047 do c = *--endptr;
1048 while( c == ' ' );
1049
1050 ++endptr;
1051 if( endptr == ptr )
1052 CV_PARSE_ERROR( "An empty key" );
1053
1054 str_hash_node = cvGetHashedKey( fs, ptr, (int)(endptr - ptr), 1 );
1055 *value_placeholder = cvGetFileNode( fs, map_node, str_hash_node, 1 );
1056 ptr = saveptr;
1057
1058 return ptr;
1059}
1060
1061
1062static char*

Callers 1

icvYMLParseValueFunction · 0.85

Calls 1

cvGetFileNodeFunction · 0.85

Tested by

no test coverage detected