std::messages<CharT>:: close, std::messages<CharT>:: do_close
From cppreference.net
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Localization library
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::messages
| Member functions | ||||
|
messages::close
messages::do_close
|
|
헤더 파일에 정의됨
<locale>
|
||
|
public
:
void close ( catalog c ) const ; |
(1) | |
|
protected
:
virtual void do_close ( catalog c ) const ; |
(2) | |
1)
Public 멤버 함수로서, 가장 파생된 클래스의 protected virtual 멤버 함수
do_close
를 호출합니다.
목차 |
매개변수
| c | - |
유효한 열린 카탈로그 식별자로,
close()
가 아직 호출되지 않은 상태
|
반환값
(없음)
참고 사항
POSIX 시스템에서 이 함수 호출은 일반적으로
catclose()
호출로 변환됩니다. GNU
gettext()
를 기반으로 구현된 GNU libstdc++에서는 아무 작업도 수행하지 않습니다.
예제
다음 예제는 메시지 검색 방법을 보여줍니다: 일반적인 GNU/Linux 시스템에서는
/usr/share/locale/de/LC_MESSAGES/sed.mo
에서 읽어옵니다.
이 코드 실행
#include <iostream> #include <locale> int main() { std::locale loc("de_DE.utf8"); std::cout.imbue(loc); auto& facet = std::use_facet<std::messages<char>>(loc); auto cat = facet.open("sed", loc); if (cat < 0) std::cout << "Could not open german \"sed\" message catalog\n"; else std::cout << "\"No match\" in German: " << facet.get(cat, 0, 0, "No match") << '\n' << "\"Memory exhausted\" in German: " << facet.get(cat, 0, 0, "Memory exhausted") << '\n'; facet.close(cat); }
가능한 출력:
"No match" in German: Keine Übereinstimmung "Memory exhausted" in German: Speicher erschöpft
참고 항목
웹페이지의 텍스트를 한국어로 번역합니다: HTML 태그나 속성은 번역하지 마십시오. 원래 형식을 유지하십시오.
,
,