Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

String Impala::File::ReadLine ( bool  skipEC = false  )  [inline]

Definition at line 73 of file File.h.

References mBuf, mBufSize, and mFp.

Referenced by Impala::Core::VideoSet::TestBlocksFile::HandleNewFile(), Impala::Core::VideoSet::ReadBlocksFile::HandleNewFile(), Impala::Core::Trec::SearchResult::Load(), and Impala::Core::Trec::SearchJudge::Load().

00074     {
00075         mBuf[0] = '\0';
00076         bool found = (skipEC) ? false : true;
00077         do
00078         {
00079             fgets(mBuf, mBufSize, mFp);
00080             if (strlen(mBuf) > 0 && mBuf[0] != '#' && mBuf[0] != '\r')
00081                 found = true;
00082             if (!found && feof(mFp))
00083                 found = true;
00084         }
00085         while (! found);
00086 
00087         int len = strlen(mBuf);
00088         if (len == 0)
00089             return String("");
00090         while ((mBuf[len-1] == '\n') || (mBuf[len-1] == '\r'))
00091         {   // strip trailing LF and CR chars
00092             mBuf[len-1] = '\0';
00093             len = len - 1;
00094         }
00095         return String(mBuf, len);
00096     }


Generated on Fri Mar 19 10:35:42 2010 for ImpalaSrc by  doxygen 1.5.1