Home || Visual Search || Applications || Architecture || 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::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             {
00084                 mBuf[0] = '\0';
00085                 found = true;
00086             }
00087         }
00088         while (! found);
00089 
00090         int len = strlen(mBuf);
00091         if (len == 0)
00092             return String("");
00093         while ((mBuf[len-1] == '\n') || (mBuf[len-1] == '\r'))
00094         {   // strip trailing LF and CR chars
00095             mBuf[len-1] = '\0';
00096             len = len - 1;
00097         }
00098         return String(mBuf, len);
00099     }


Generated on Thu Jan 13 09:13:57 2011 for ImpalaSrc by  doxygen 1.5.1