Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
setlocale.h
Go to the documentation of this file.
1
32#ifndef _RWSTD_LOC_RW_SETLOCALE_H_INCLUDED
33#define _RWSTD_LOC_RW_SETLOCALE_H_INCLUDED
34
35
36#include "podarray.h"
37#include <rw/_defs.h>
38
39
41
42// class provides synchronized access to the C setlocale() facility
43// if the first argument is 0, ctor locks, obtains the name of the
44// current C locale (by calling setlocale (0)), and unlocks
45// if the first argument is not 0, ctor locks and obtains and saves
46// the name of the current C locale, and sets the C locale to that
47// named by the first argument; dtor then resets the global C locale
48// to what it was before the ctor invocation and unlocks
49
50struct _RWSTD_EXPORT __rw_setlocale
51{
52 __rw_setlocale (const char* = 0, int = _RWSTD_LC_ALL, int = 0);
53
54 ~__rw_setlocale ();
55
56 // returns the saved name (will not be 0)
57 const char* name () const {
58 return _C_name;
59 }
60
61private:
62
63 __rw_setlocale (const __rw_setlocale&); // not defined
64 void operator= (const __rw_setlocale&); // not defined
65
66 char _C_namebuf [80]; // used if locale name fits
67 char *_C_name; // _C_namebuf if name fits, otherwise allocated
68 int _C_guard; // non-0 when object owns the global lock
69 int _C_cat; // saved LC_XXX category
70};
71
72
73char* __rw_locale_name (int, const char*, __rw_chararray&);
74
75
76} // namespace __rw
77
78
79#endif // _RWSTD_LOC_RW_SETLOCALE_H_INCLUDED
#define _RWSTD_EXPORT
Definition _defs.h:485
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
const char * name
Definition codecvt1.cpp:72