getline
입력된 스트림-줄에서 문자열을 추출 합니다.
template<class CharType, class Traits, class Allocator>
basic_istream<CharType, Traits>& getline(
basic_istream<CharType, Traits>& _Istr,
basic_string<CharType, Traits, Allocator>& _Str
);
template<class CharType, class Traits, class Allocator>
basic_istream< CharType, Traits >& getline(
basic_istream< CharType, Traits >& _Istr,
basic_string< CharType, Traits, Allocator >& _Str,
CharType _Delim
);
template<class Allocator, class Traits, class Allocator>
basic_istream< Allocator, Traits >& getline(
basic_istream< Allocator, Traits >&& _Istr,
basic_string< Allocator, Traits, Allocator >& _Str
);
template<class CharType, class Traits, class Allocator>
basic_istream<CharType, Traits>& getline(
basic_istream<CharType, Traits>&& _Istr,
basic_string<CharType, Traits, Allocator>& _Str,
const CharType _Delim
);
매개 변수
_Istr
문자열 추출 되는 입력된 스트림._Str
문자열에 문자는 입력된 스트림에서 읽을 수 있습니다._Delim
줄 구분 기호입니다.
반환 값
The first function returns getline( _Istr, _Str, _Istr.widen( '\n' ) ).
두 번째 함수에 의해 제어 되는 시퀀스를 대체 _Str stream에서 추출한 요소 시퀀스를 가진 _Istr.
이전 것 같지만 매우 나머지 함수는 Lvalue가 고 Rvalue.
설명
추출 순서 대로 테스트를 중지합니다.
파일의 끝에.
함수는 같음 비교 요소 추출 후 delim, 경우 요소입니다 놔도 제어 되는 시퀀스에 추가 합니다.
이 함수를 추출한 후 str.max_size 요소는 case 함수 호출 setstate(ios_base::failbit).
함수 요소를 추출 하는 경우이 호출 setstate(failbit).어떤 경우에 반환 _Istr.
예제
참조 하십시오 string::getline 를 사용 하는 예에 대 한 getline.
요구 사항
헤더: <string>
네임 스페이스: 국방 표준