nsmcp::BoundedLogScanner method nextLine (public)
<instance of nsmcp::BoundedLogScanner> nextLine position \ [ filter ]
Defined in /usr/local/ns/tcl/nsmcp/log-01-scanner.tcl
Read an in-memory physical line, optionally using the literal prefilter. Return physical byte bounds and newline status without parsing or redacting the record.
- Parameters:
- position (required)
- Physical byte cursor within the loaded chunk.
- filter (optional, defaults to
"true")- Whether to apply the literal candidate prefilter; false reads sequentially. Defaults to 'true'.
- Returns:
- A dictionary with start, end, raw and terminated fields, or an empty result at exhaustion.
- Testcases:
- No testcase defined.
Source code: if {${:channel} ne ""} { error "nextLine requires an in-memory scanner" } if {$position<0 || $position>${:limit}} { error "invalid line cursor" } if {$position==${:limit}} { return {} } if {$filter} { set found [:find $position] if {$found<0} { return {} } set start [expr {[string last \n ${:buffer} [expr {$found-1}]]+1}] } else { set start $position } set end [string first \n ${:buffer} $start] set terminated [expr {$end>=0}] if {!$terminated} { set end ${:limit} } return [dict create start $start end [expr {$end+($terminated ? 1 : 0)}] raw [string range ${:buffer} $start [expr {$end-1}]] terminated $terminated]XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)