Skip to content

rose_getline

Reads a line of text from a stream.

Synopses

Declared in <rose_getline.h>

[[visibility]]
std::string
rose_getline(std::istream& stream);

Reads a line of text from a stream.

[[visibility]]
std::string
rose_getline(FILE* stream);
[[visibility]]
ssize_t
rose_getline(
    char** lineptr,
    size_t* n,
    std::istream& stream);

Reads a line of text from a stream.

[[visibility]]
ssize_t
rose_getline(
    char** lineptr,
    size_t* n,
    FILE* stream);

Return Value

  • Line content including terminators, or empty string on EOF.

  • Number of characters read, or ‐1 on EOF/error.

Parameters

Name

Description

stream

Input stream.

lineptr

Pointer to the buffer pointer (may be null to allocate).

n

Pointer to the buffer length in bytes.

Created with MrDocs