GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::messages::close,std::messages::do_close(3) C++ Standard Libary std::messages::close,std::messages::do_close(3)

std::messages::close,std::messages::do_close - std::messages::close,std::messages::do_close


Defined in header <locale>
public: (1)
void close( catalog c ) const;
protected: (2)
virtual void do_close( catalog c ) const;


1) public member function, calls the protected virtual member function do_close of
the most derived class.


2) Releases the implementation-defined resources associated with an open catalog
that is designated by the value c of type catalog (inherited from
std::messages_base), which was obtained from open().


c - a valid open catalog identifier, on which close() has not yet been called


(none)


On POSIX systems, this function call usually translates to a call to catclose(). In
GNU libstdc++, which is implemented in terms of GNU gettext(), it does nothing.


The following example demonstrated retrieval of messages: on a typical GNU/Linux
system it reads from /usr/share/locale/de/LC_MESSAGES/sed.mo

// Run this code


#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

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.