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

Function icvGets

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

Source from the content-addressed store, hash-verified

287}
288
289static 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
319static int icvEof( CvFileStorage* fs )
320{

Callers 3

icvYMLSkipSpacesFunction · 0.85
icvXMLSkipSpacesFunction · 0.85
persistence.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected