locate_line_with_offset

Defined in header: <orcus/stream.hpp>

line_with_offset orcus::locate_line_with_offset(std::string_view strm, std::ptrdiff_t offset)

Given a string consisting of multiple lines i.e. multiple line breaks, find the line that contains the specified offset position.

Parameters:
  • strm – string stream containing multiple lines to search.

  • offset – offset position.

Throws:

std::invalid_argument – if the offset value equals or exceeds the length of the string stream being searched.

Returns:

structure containing information about the line containing the offset position.