File Index Symbol Index

// xlocmes internal header (from <locale>)
#pragma once
#ifndef _XLOCMES_
#define _XLOCMES_
#ifndef RC_INVOKED
#include <xiosbase>
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// STRUCT messages_base
struct
messages_base
:
public
locale
::
facet
{
// base class for messages
typedef
int
catalog
;
explicit
messages_base
(
size_t
_Refs
=
0
) :
locale
::
facet
(
_Refs
) {
// default constructor
} };
// CLASS TEMPLATE messages
template
<
class
_Elem
>
class
messages
:
public
messages_base
{
// facet for obtaining messages from a catalog
public
:
typedef
_Elem
char_type
;
typedef
basic_string
<
_Elem
,
char_traits
<
_Elem
>,
allocator
<
_Elem
> >
string_type
;
catalog
open
(
const
string
&
_Catname
,
const
locale
&
_Loc
)
const
{
// open catalog
return
(
do_open
(
_Catname
,
_Loc
)); }
string_type
get
(
catalog
_Catval
,
int
_Set
,
int
_Message
,
const
string_type
&
_Dflt
)
const
{
// get message from set in catalog
return
(
do_get
(
_Catval
,
_Set
,
_Message
,
_Dflt
)); }
void
close
(
catalog
_Catval
)
const
{
// close catalog
do_close
(
_Catval
); }
explicit
messages
(
size_t
_Refs
=
0
) :
messages_base
(
_Refs
) {
// construct from current locale
_Init
(
_Lobj
); }
messages
(
const
_Locinfo
&
_Lobj
,
size_t
_Refs
=
0
) :
messages_base
(
_Refs
) {
// construct from specified locale
_Init
(
_Lobj
); }
static
size_t
_Getcat
(
const
locale
::
facet
**
_Ppf
=
nullptr
,
const
locale
*
_Ploc
=
nullptr
) {
// return locale category mask and construct standard facet
if
(
_Ppf
!=
nullptr
&& *
_Ppf
==
nullptr
) *
_Ppf
=
new
messages
<
_Elem
>(
_Locinfo
(
_Ploc
->
c_str
())); }
protected
:
messages
(
const
char
*
_Locname
,
size_t
_Refs
=
0
) :
messages_base
(
_Refs
) {
// construct from specified locale
_Init
(
_Lobj
); } {
// destroy the object
}
void
_Init
(
const
_Locinfo
&) {
// initialize from _Locinfo object (do nothing)
} {
// open catalog (do nothing)
return
(-
1
); }
const
string_type
&
_Dflt
)
const
{
// get message from set in catalog (return default)
return
(
_Dflt
); } {
// close catalog (do nothing)
} };
// STATIC messages::id OBJECT
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdllimport-static-field-def"
#endif /* __clang__ */
template
<
class
_Elem
>
#ifdef __clang__
#pragma clang diagnostic pop
#endif /* __clang__ */
// CLASS TEMPLATE messages_byname
template
<
class
_Elem
>
class
messages_byname
:
public
messages
<
_Elem
> {
// messages for named locale
public
:
explicit
messages_byname
(
const
char
*
_Locname
,
size_t
_Refs
=
0
) :
messages
<
_Elem
>(
_Locname
,
_Refs
) {
// construct for named locale
}
explicit
messages_byname
(
const
string
&
_Str
,
size_t
_Refs
=
0
) :
messages
<
_Elem
>(
_Str
.
c_str
(),
_Refs
) {
// construct for named locale
}
protected
: {
// destroy the object
} };
#if defined(_DLL_CPPLIB)
#if !defined(_CRTBLD) || defined(__FORCE_INSTANCE)
#ifdef __FORCE_INSTANCE
template __PURE_APPDOMAIN_GLOBAL locale::id messages<unsigned short>::id;
#endif /* __FORCE_INSTANCE */ #endif /* defined(_DLL_CPPLIB) */
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
/* * Copyright (c) by P.J. Plauger. All rights reserved. * Consult your license regarding permissions and restrictions. V6.50:0009 */