| 1027 | |
| 1028 | |
| 1029 | static char* |
| 1030 | icvYMLParseKey( 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 | |
| 1062 | static char* |
no test coverage detected