SECEditBlockBuffer::GetTextBlock

Retrieves a pointer to or copies a block of textfrom the text buffer

Defined in: SECEditBlockBuffer.cpp

Syntax

virtual int GetTextBlock(LPCTSTR& lpszBlock, int nStartLine, int nStartCol = 0, int nEndLine = -1, int nEndCol = -1);

virtual BOOL GetTextBlock(CString& strBlock, int nStartLine, int nStartCol = 0, int nEndLine = -1, int nEndCol = -1);

Return Value

The number of TCHARs that contain the requested text, or -1 for failure.

Parameters

lpszBlock

Output parameter. Pointer reference to the block of text to assign.

strBlock

Output parameter. A CString that the requested block is copied into.

nStartLine

The starting text line index.

nStartCol

The starting column index of text.

nEndLine

The ending text line index.

nEndCol

The ending column of index.

Comments

If nEndLine and nEndCol are -1, then the requested block is up to and including the line end characters of the line specified by nStartLine.

Developer Notes

SECEditViewport, SECEditController, and SECEdit will always call the first override that sets the pointer to the block of text. If this returns -1, then Objective Edit will call the second override that tkaes the CString reference parameter. The provided implementation of ISECEditBuffer, SECEditBlockBuffer stores its text in an array of blocks of text, so it can always return the pointer to the text unless the requested text spans a block boundary. These blocks are always bounded by a line end, so a request for the pointer to text on a single line will always succeed when using the default implementation. If you derive your own implementation of ISECEditBuffer, it is recommended that you can return the pointer to the text if possible, even if on a line by line basis.

See Also

SECEditBlockBuffer  ISECEditBuffer  SECEditViewport  SECEditController  SECEdit