copyRecords

fun copyRecords(recordIds: IntArray, lifecycleStates: IntArray, promptStartLineIds: LongArray, promptEndLineIds: LongArray, commandStartLineIds: LongArray, commandEndLineIds: LongArray, exitCodes: IntArray, destinationOffset: Int, maxRecords: Int): Int

Copies retained shell command records into caller-owned primitive arrays.

Records are copied in chronological order, oldest first. This method clears exactly maxRecords destination slots starting at destinationOffset before copying, so callers can safely reuse destination buffers across calls without retaining stale records. Exit codes use TerminalShellIntegrationCommandRecord.UNKNOWN_EXIT_CODE when omitted, malformed, not finished, or otherwise unknown.

Return

number of actual records copied.

Parameters

recordIds

destination record-id column.

lifecycleStates

destination lifecycle-state column.

promptStartLineIds

destination prompt-start line-id column.

promptEndLineIds

destination prompt-end line-id column.

commandStartLineIds

destination command-start line-id column.

commandEndLineIds

destination command-end line-id column.

exitCodes

destination exit-code column.

destinationOffset

first destination index in all destination arrays.

maxRecords

maximum number of destination records to clear and copy.