| 178 | } |
| 179 | |
| 180 | void 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 | |
| 201 | void FileObject::writeLine(const U8 *line) |
| 202 | { |