cpp_scanFirst: File Scanner

View source: R/RcppExports.R

cpp_scanFirstR Documentation

File Scanner

Description

Scans file for 1st occurence of a target string. If found, it returns the position in bytes of the target. Otherwise, it returns 0.

Arguments

fname

string, path to file.

raw

a Rcpp::RawVector, exact target to be searched for. When converted to string it should be of at least 1 character and not exceed 1024 characters.

start

size_t, position where to begin search. It can't be superior or equal than file size or end (when end is different from 0 and inferior than file size).

end

size_t, position where to stop searching. Default is 0. Search will end up at this position unless it is higher than file size. In such case, search will end up when file end will be reached.

buf_size

uint8_t, size of buffer used to search for target (in kilo-Bytes, will be forced to be between 2 and 1024). Default is 64.

Value

size_t index of first target character found within target plus 1 or 0 if not found.


IFC documentation built on Sept. 14, 2023, 1:08 a.m.