std::basic_ios<CharT,Traits>:: imbue
| I/O manipulators | ||||
| Print functions (C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(C++20)
|
||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
| Synchronized Output | ||||
|
(C++20)
|
||||
| Types | ||||
| Error category interface | ||||
|
(C++11)
|
||||
|
(C++11)
|
| Member functions | ||||
| State functions | ||||
| Formatting | ||||
| Miscellaneous | ||||
|
basic_ios::imbue
|
||||
| Protected member functions | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
|
std::
locale
로케일 설정
(
const
std::
locale
&
loc
)
;
|
||
현재 로케일을 대체합니다. 효과적으로 ios_base :: imbue ( loc ) 를 호출하고, 연결된 스트림 버퍼가 있는 경우 ( rdbuf ( ) ! = 0 ), rdbuf ( ) - > pubimbue ( loc ) 를 호출합니다.
목차 |
매개변수
| loc | - | 새로운 로케일 |
반환값
이전 로케일, ios_base :: imbue ( loc ) 에서 반환된 값.
예외
구현 정의 예외를 던질 수 있습니다.
예제
#include <iostream> #include <locale> #include <sstream> int main() { std::istringstream iss; iss.imbue(std::locale("en_US.UTF8")); std::cout << "Current locale: " << iss.getloc().name() << '\n'; iss.imbue(std::locale()); std::cout << "Global locale : " << iss.getloc().name() << '\n'; }
출력:
Current locale: en_US.UTF8 Global locale : C