Class: TextLinesBuffer

Kekule. TextLinesBuffer

new TextLinesBuffer(textOrLines)

A helper class to read / write text data organized in lines.
Parameters:
Name Type Description
textOrLines Variant A pack of text (String) or lines (Array) to read.
Properties:
Name Type Description
text String Text data to handle.
lines Array Each item is a line of text.
currLineNo Integer Which line is currently reading.
Source:

Extends

  • ObjectEx

Methods

appendLines(lines)

Append lines of text to current one.
Parameters:
Name Type Description
lines Array
Source:

appendText(text)

Append text to current one.
Parameters:
Name Type Description
text String
Source:

clear()

Clear text and lines.
Source:

eof() → {Bool}

Check whether all lines are read and currLineNo point to end of data.
Source:
Returns:
Type
Bool

getCurrLine() → {String}

Get value of current line but not move currLineNo to next line.
Source:
Returns:
Type
String

getLineAt(index) → {String}

Get value of line in index.
Parameters:
Name Type Description
index Int
Source:
Returns:
Type
String

getUnreadLines() → {String}

Get lines unread (below currLinNo).
Source:
Returns:
Type
String

getUnreadText() → {String}

Get text unread (below currLinNo).
Source:
Returns:
Type
String

readLine() → {String}

Get value of current line and move currLineNo to next line.
Source:
Returns:
Type
String

reset()

Reset currLineNo to zero (beginning of text data).
Source:

writeLine(line)

Insert a line at current position and move currLineNo to next line.
Parameters:
Name Type Description
line String
Source:

writeLines(lines)

Insert array of lines at current position and move currLineNo.
Parameters:
Name Type Description
lines Array
Source:

writeText(text)

Insert text at current position and move currLineNo. Text may have line breaks.
Parameters:
Name Type Description
text String
Source:

Kekule. TextLinesBuffer

new TextLinesBuffer()

Source:

Methods

appendLines(lines)

Append lines of text to current one.
Parameters:
Name Type Description
lines Array
Source:

appendText(text)

Append text to current one.
Parameters:
Name Type Description
text String
Source:

clear()

Clear text and lines.
Source:

eof() → {Bool}

Check whether all lines are read and currLineNo point to end of data.
Source:
Returns:
Type
Bool

getCurrLine() → {String}

Get value of current line but not move currLineNo to next line.
Source:
Returns:
Type
String

getLineAt(index) → {String}

Get value of line in index.
Parameters:
Name Type Description
index Int
Source:
Returns:
Type
String

getUnreadLines() → {String}

Get lines unread (below currLinNo).
Source:
Returns:
Type
String

getUnreadText() → {String}

Get text unread (below currLinNo).
Source:
Returns:
Type
String

readLine() → {String}

Get value of current line and move currLineNo to next line.
Source:
Returns:
Type
String

reset()

Reset currLineNo to zero (beginning of text data).
Source:

writeLine(line)

Insert a line at current position and move currLineNo to next line.
Parameters:
Name Type Description
line String
Source:

writeLines(lines)

Insert array of lines at current position and move currLineNo.
Parameters:
Name Type Description
lines Array
Source:

writeText(text)

Insert text at current position and move currLineNo. Text may have line breaks.
Parameters:
Name Type Description
text String
Source: