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

virtual String Impala::Util::IOBufferFile::ReadLine (  )  [inline, virtual]

only for ascii (not binary) entities

Reimplemented from Impala::Util::IOBuffer.

Definition at line 112 of file IOBufferFile.h.

References Impala::Util::IOBuffer::Available(), FSeek(), FTell(), Impala::Util::IOBuffer::GetPosition(), mFile, mUseMemory, Impala::Util::IOBuffer::ReadLine(), and SetPosition().

00113     {
00114         if (mUseMemory)
00115             return IOBuffer::ReadLine();
00116 
00117         // todo : this is a very inefficient implementation
00118         Int64 available = Available();
00119         Int64 maxLineSize = 1048576; // 1 Mb, todo : give user control
00120         if (available < maxLineSize)
00121             maxLineSize = available + 1; // extra space for '\0'
00122         // RvB: In debug mode this caused waiting time of up to 8 minutes
00123         //char* buf = new char[maxLineSize];
00124         static char buf[1024 * 1024];
00125         FSeek(mFile, GetPosition(), SEEK_SET);
00126         fgets(buf, maxLineSize, mFile);
00127         SetPosition(FTell(mFile));
00128         for (int i=0 ; i<maxLineSize ; i++)
00129         {
00130             if ((buf[i] == '\r') || (buf[i] == '\n'))
00131             {
00132                 buf[i] = '\0';
00133                 break;
00134             }
00135         }
00136         String res(buf);
00137         //delete buf;
00138         return res;
00139     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:40:42 2010 for ImpalaSrc by  doxygen 1.5.1