RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
Classes.LineStart Function

Finds the end of the last whole line in a buffer.

Pascal
function LineStart(Buffer: PChar; BufPos: PChar): PChar;
C++
const char * LineStart(const char * Buffer, const char * BufPos);

Classes

Use LineStart to find the start of the last partial line in the buffer. LineStart starts at BufPos and scans backwards for a line-feed character (\n). It returns a pointer to that character. If no line-feed char is found, it returns the Buffer pointer. Buffer should point to the beginning of a block of memory and BufPos to the end of the block you want to scan.

Note: The undocumented TParser class uses LineStart to locate line-endings in chunks of text read into a fixed-size buffer. When the last full line of text is parsed, the parser moves the last partial line of text from the end of the buffer to the front and fills the rest of the buffer with new data from disk.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!