[locale.messages.virtuals] # 28 Text processing library [[text]](./#text) ## 28.3 Localization library [[localization]](localization#locale.messages.virtuals) ### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.messages.virtuals) #### 28.3.4.8 The message retrieval category [[category.messages]](category.messages#locale.messages.virtuals) #### 28.3.4.8.2 Class template messages [[locale.messages]](locale.messages#virtuals) #### 28.3.4.8.2.3 Virtual functions [locale.messages.virtuals] [🔗](#lib:messages,do_open) `catalog do_open(const string& name, const locale& loc) const; ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4819) *Returns*: A value that may be passed to get() to retrieve a message from the message catalog identified by the string name according to an implementation-defined mapping[.](#1.sentence-1) The result can be used until it is passed to close()[.](#1.sentence-2) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4828) Returns a value less than 0 if no such catalog can be opened[.](#2.sentence-1) [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4831) *Remarks*: The locale argument loc is used for character set code conversion when retrieving messages, if needed[.](#3.sentence-1) [🔗](#lib:messages,do_get) `string_type do_get(catalog cat, int set, int msgid, const string_type& dfault) const; ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4843) *Preconditions*: cat is a catalog obtained from open() and not yet closed[.](#4.sentence-1) [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4847) *Returns*: A message identified by arguments set, msgid, and dfault, according to an implementation-defined mapping[.](#5.sentence-1) If no such message can be found, returns dfault[.](#5.sentence-2) [🔗](#lib:message,do_close) `void do_close(catalog cat) const; ` [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4862) *Preconditions*: cat is a catalog obtained from open() and not yet closed[.](#6.sentence-1) [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4866) *Effects*: Releases unspecified resources associated with cat[.](#7.sentence-1) [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4870) *Remarks*: The limit on such resources, if any, isimplementation-defined[.](#8.sentence-1)