R/RcppExports.R

Defines functions stream_read_message_cpp stream_write_message_cpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Write a length prefixed message to a stream
#' 
#' @param message The message to write
#' @param stream The name of the stream to read from. Defaults to `stdout`.
#' @param offset The offset from the start of the file to start reading from.
#' @returns `TRUE` if the message was successfully written, `FALSE` otherwise.
stream_write_message_cpp <- function(message, stream = "stdout", offset = -1L) {
    .Call('_rasta_stream_write_message', PACKAGE = 'rasta', message, stream, offset)
}

#' Read a length prefixed message from a stream.
#' 
#' @param stream The name of the stream to read from. Defaults to `stdin`.
#' @param offset The offset from the start of the file to start reading from.
#' @param blocking Should the read be a blocking operation?
#' @returns The message as a string.
stream_read_message_cpp <- function(stream = "stdin", offset = -1L, blocking = TRUE) {
    .Call('_rasta_stream_read_message', PACKAGE = 'rasta', stream, offset, blocking)
}
stencila/rasta documentation built on Oct. 12, 2021, 10:26 p.m.