| 287 | } |
| 288 | |
| 289 | static char* icvGets( CvFileStorage* fs, char* str, int maxCount ) |
| 290 | { |
| 291 | if( fs->strbuf ) |
| 292 | { |
| 293 | size_t i = fs->strbufpos, len = fs->strbufsize; |
| 294 | int j = 0; |
| 295 | const char* instr = fs->strbuf; |
| 296 | while( i < len && j < maxCount-1 ) |
| 297 | { |
| 298 | char c = instr[i++]; |
| 299 | if( c == '\0' ) |
| 300 | break; |
| 301 | str[j++] = c; |
| 302 | if( c == '\n' ) |
| 303 | break; |
| 304 | } |
| 305 | str[j++] = '\0'; |
| 306 | fs->strbufpos = i; |
| 307 | return j > 1 ? str : 0; |
| 308 | } |
| 309 | if( fs->file ) |
| 310 | return fgets( str, maxCount, fs->file ); |
| 311 | #if USE_ZLIB |
| 312 | if( fs->gzfile ) |
| 313 | return gzgets( fs->gzfile, str, maxCount ); |
| 314 | #endif |
| 315 | CV_Error( CV_StsError, "The storage is not opened" ); |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | static int icvEof( CvFileStorage* fs ) |
| 320 | { |
no outgoing calls
no test coverage detected