#pragma once
#ifndef _LOCALE_
#define _LOCALE_
#ifndef RC_INVOKED
#include <string>
#include <xlocbuf>
#include <xlocmes>
#include <xlocmon>
#include <xlocnum>
#include <xloctime>
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,_STL_WARNING_LEVEL)
#pragma warning(disable: _STL_DISABLED_WARNINGS)
#pragma warning(disable:
4455
4494
4619
4643
4702
4984
4988
)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
template
<
class
>
class
:
public
::
{
public
:
typedef
;
typedef
<
,
<
>,
<
> >
;
int
(
const
*
,
const
*
,
const
*
,
const
*
)
const
{
return
(
(
,
,
,
));
}
(
const
*
,
const
*
)
const
{
return
(
(
,
));
}
long
(
const
*
,
const
*
)
const
{
return
(
(
,
));
}
__PURE_APPDOMAIN_GLOBAL _CRTIMP2_PURE_IMPORT static locale::id id; // unique facet id
__declspec
(dllimport)
static
::
;
explicit
(
=
0
)
:
::
(
)
{
(
_Lobj
);
}
(
const
&
,
=
0
)
:
::
(
)
{
(
);
}
static
(
const
::
**
=
nullptr
,
const
*
=
nullptr
)
{
if
(
!=
nullptr
&& *
==
nullptr
)
*
=
new
<
>(
(
->
().
()));
}
protected
:
__CLR_OR_THIS_CALL ~collate() noexcept
{
_CSTD free(_Coll._LocaleName);
}
protected
:
(
const
char
*
,
=
0
)
:
::
(
)
{
_BEGIN_LOCINFO(_Lobj(_Locname))
(
_Lobj
);
}
void
(
const
&
)
{
.
();
}
virtual int __CLR_OR_THIS_CALL do_compare(const _Elem *_First1, const _Elem *_Last1,
virtual
int
(
const
*
,
const
*
,
const
*
,
const
*
)
const
{
(
,
);
(
,
);
int
=
(
,
,
,
, &
);
return
(
_Ans
0
? -
1
:
_Ans
0
?
0
: +
1
);
}
virtual string_type __CLR_OR_THIS_CALL do_transform(const _Elem *_First,
const
*
)
const
{
(
,
);
;
;
for
(
_Count
=
static_cast
<
>(
-
);
0
_Count
; )
{
_Str
.
(
_Count
);
if
((
_Count
=
(&
_Str
.
(),
&
_Str
.
() +
_Str
.
(),
,
, &
)) <=
_Str
.
())
break
;
}
_Str
.
(
_Count
);
return
(
_Str
);
}
virtual long __CLR_OR_THIS_CALL do_hash(const _Elem *_First, const _Elem *_Last) const
virtual
long
(
const
*
,
const
*
)
const
{
(
,
);
return
(
static_cast
<
long
>(
_Hash_array_representation
(
,
static_cast
<
>(
-
))));
}
private
:
::
;
};
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdllimport-static-field-def"
#endif /* __clang__ */
template
<
class
>
__PURE_APPDOMAIN_GLOBAL locale::id collate<_Elem>::id;
#if defined(_DLL_CPPLIB)
#if !defined(_CRTBLD) || defined(__FORCE_INSTANCE)
template __PURE_APPDOMAIN_GLOBAL locale::id collate<char>::id;
template __PURE_APPDOMAIN_GLOBAL locale::id collate<wchar_t>::id;
#endif /* !defined(_CRTBLD) || defined(__FORCE_INSTANCE) */
template
::
<
wchar_t
>::id;
#ifdef __FORCE_INSTANCE
template __PURE_APPDOMAIN_GLOBAL locale::id collate<unsigned short>::id;
#endif /* __FORCE_INSTANCE */
#endif /* defined(_DLL_CPPLIB) */
#ifdef __clang__
#pragma clang diagnostic pop
#endif /* __clang__ */
template
<
class
>
class
:
public
<
>
{
public
:
explicit
(
const
char
*
,
=
0
)
:
<
>(
,
)
{
}
explicit
(
const
&
,
=
0
)
:
<
>(
(
.
()),
)
{
}
protected
:
virtual __CLR_OR_THIS_CALL ~collate_byname() noexcept
{
}
};
template
<
class
>
inline
bool
(
const
&
)
noexcept
{
_BEGIN_LOCK(_LOCK_LOCALE) // the thread lock, make get atomic
=
::id;
return
(
.
(
_Id
) !=
nullptr
||
::_Getcat() != (
)(-
1
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::alnum, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::alpha, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::blank, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::cntrl, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::digit, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::graph, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::lower, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::print, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::punct, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::space, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::upper, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
bool
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::xdigit, _Ch));
return
(::
std
::
<
<
>>(
).
(
::
,
));
}
template
<
class
>
inline
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).tolower(_Ch));
return
(::
std
::
<
<
>>(
).
(
));
}
template
<
class
>
inline
(
)(
,
const
&
)
{
return (_STD use_facet<ctype<_Elem>>(_Loc).toupper(_Ch));
return
(::
std
::
<
<
>>(
).
(
));
}
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _LOCALE_ */
#pragma pack(pop)