MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / peekLine

Method peekLine

Engine/source/core/fileObject.cpp:180–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180void FileObject::peekLine( U8* line, S32 length )
181{
182 if(!mFileBuffer)
183 {
184 line[0] = '\0';
185 return;
186 }
187
188 // Copy the line into the buffer. We can't do this like readLine because
189 // we can't modify the file buffer.
190 S32 i = 0;
191 U32 tokPos = mCurPos;
192 while( ( tokPos != mBufferSize ) && ( mFileBuffer[tokPos] != '\r' ) && ( mFileBuffer[tokPos] != '\n' ) && ( i < ( length - 1 ) ) )
193 line[i++] = mFileBuffer[tokPos++];
194
195 line[i++] = '\0';
196
197 //if( i == length )
198 //Con::warnf( "FileObject::peekLine - The line contents could not fit in the buffer (size %d). Truncating.", length );
199}
200
201void FileObject::writeLine(const U8 *line)
202{

Callers 1

fileObject.cppFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected