bsl::basic_istringstream::getline

String extraction.

Synopsis

Declared in <bslstl_istringstream.h>

__istream_type&
getline(
    char_type* __s,
    streamsize __n,
    char_type __delim);

Description

Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit.

-# the input sequence reaches end-of-file, in which case eofbit is set in the stream error state -# the next character equals __delim, in which case the character is extracted (and therefore counted in gcount()) but not stored -# __n-1 characters are stored, in which case failbit is set in the stream error state

If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.)

In any case, a null character is stored in the next location in the array.

Return Value

*this

Parameters

NameDescription
__sA character array in which to store the data.
__nMaximum number of characters to extract.
__delimA "stop" character.