build/stlport/src/locale.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /*
michael@0 2 * Copyright (c) 1999
michael@0 3 * Silicon Graphics Computer Systems, Inc.
michael@0 4 *
michael@0 5 * Copyright (c) 1999
michael@0 6 * Boris Fomitchev
michael@0 7 *
michael@0 8 * This material is provided "as is", with absolutely no warranty expressed
michael@0 9 * or implied. Any use is at your own risk.
michael@0 10 *
michael@0 11 * Permission to use or copy this software for any purpose is hereby granted
michael@0 12 * without fee, provided the above notices are retained on all copies.
michael@0 13 * Permission to modify the code and to distribute modified code is granted,
michael@0 14 * provided the above notices are retained, and a notice that the code was
michael@0 15 * modified is included with the above copyright notice.
michael@0 16 *
michael@0 17 */
michael@0 18
michael@0 19 #include "stlport_prefix.h"
michael@0 20
michael@0 21 #include <locale>
michael@0 22 #include <stdexcept>
michael@0 23
michael@0 24 #include "c_locale.h"
michael@0 25 #include "locale_impl.h"
michael@0 26
michael@0 27 _STLP_BEGIN_NAMESPACE
michael@0 28
michael@0 29 #define _NAMELESS "*"
michael@0 30 static const char _Nameless[] = _NAMELESS;
michael@0 31
michael@0 32 static inline bool is_C_locale_name (const char* name)
michael@0 33 { return ((name[0] == 'C') && (name[1] == 0)); }
michael@0 34
michael@0 35 locale* _Stl_get_classic_locale();
michael@0 36 locale* _Stl_get_global_locale();
michael@0 37
michael@0 38 #if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) || \
michael@0 39 defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) || defined (_STLP_CHECK_RUNTIME_COMPATIBILITY)
michael@0 40 # define locale _STLP_NO_MEM_T_NAME(loc)
michael@0 41 #endif
michael@0 42
michael@0 43 locale::facet::~facet() {}
michael@0 44
michael@0 45 #if !defined (_STLP_MEMBER_TEMPLATES) || defined (_STLP_INLINE_MEMBER_TEMPLATES)
michael@0 46 // members that fail to be templates
michael@0 47 bool locale::operator()(const string& __x,
michael@0 48 const string& __y) const
michael@0 49 { return __locale_do_operator_call(*this, __x, __y); }
michael@0 50
michael@0 51 # if !defined (_STLP_NO_WCHAR_T)
michael@0 52 bool locale::operator()(const wstring& __x,
michael@0 53 const wstring& __y) const
michael@0 54 { return __locale_do_operator_call(*this, __x, __y); }
michael@0 55 # endif
michael@0 56 #endif
michael@0 57
michael@0 58 void _STLP_CALL locale::_M_throw_on_null_name()
michael@0 59 { _STLP_THROW(runtime_error("Invalid null locale name")); }
michael@0 60
michael@0 61 void _STLP_CALL locale::_M_throw_on_combine_error(const string& name) {
michael@0 62 string what = "Unable to find facet";
michael@0 63 what += " in ";
michael@0 64 what += name.empty() ? "system" : name.c_str();
michael@0 65 what += " locale";
michael@0 66 _STLP_THROW(runtime_error(what.c_str()));
michael@0 67 }
michael@0 68
michael@0 69 void _STLP_CALL locale::_M_throw_on_creation_failure(int __err_code,
michael@0 70 const char* name, const char* facet) {
michael@0 71 string what;
michael@0 72 switch (__err_code) {
michael@0 73 case _STLP_LOC_UNSUPPORTED_FACET_CATEGORY:
michael@0 74 what = "No platform localization support for ";
michael@0 75 what += facet;
michael@0 76 what += " facet category, unable to create facet for ";
michael@0 77 what += name[0] == 0 ? "system" : name;
michael@0 78 what += " locale";
michael@0 79 break;
michael@0 80 case _STLP_LOC_NO_PLATFORM_SUPPORT:
michael@0 81 what = "No platform localization support, unable to create ";
michael@0 82 what += name[0] == 0 ? "system" : name;
michael@0 83 what += " locale";
michael@0 84 break;
michael@0 85 default:
michael@0 86 case _STLP_LOC_UNKNOWN_NAME:
michael@0 87 what = "Unable to create facet ";
michael@0 88 what += facet;
michael@0 89 what += " from name '";
michael@0 90 what += name;
michael@0 91 what += "'";
michael@0 92 break;
michael@0 93 case _STLP_LOC_NO_MEMORY:
michael@0 94 _STLP_THROW_BAD_ALLOC;
michael@0 95 break;
michael@0 96 }
michael@0 97
michael@0 98 _STLP_THROW(runtime_error(what.c_str()));
michael@0 99 }
michael@0 100
michael@0 101 // Takes a reference to a locale::id, assign a numeric index if not already
michael@0 102 // affected and returns it. The returned index is always positive.
michael@0 103 static const locale::id& _Stl_loc_get_index(locale::id& id) {
michael@0 104 if (id._M_index == 0) {
michael@0 105 #if defined (_STLP_ATOMIC_INCREMENT) && !defined (_STLP_WIN95_LIKE)
michael@0 106 static _STLP_VOLATILE __stl_atomic_t _S_index = __STATIC_CAST(__stl_atomic_t, locale::id::_S_max);
michael@0 107 id._M_index = _STLP_ATOMIC_INCREMENT(&_S_index);
michael@0 108 #else
michael@0 109 static _STLP_STATIC_MUTEX _Index_lock _STLP_MUTEX_INITIALIZER;
michael@0 110 _STLP_auto_lock sentry(_Index_lock);
michael@0 111 size_t new_index = locale::id::_S_max++;
michael@0 112 id._M_index = new_index;
michael@0 113 #endif
michael@0 114 }
michael@0 115 return id;
michael@0 116 }
michael@0 117
michael@0 118 // Default constructor: create a copy of the global locale.
michael@0 119 locale::locale() _STLP_NOTHROW
michael@0 120 : _M_impl(_get_Locale_impl(_Stl_get_global_locale()->_M_impl))
michael@0 121 {}
michael@0 122
michael@0 123 // Copy constructor
michael@0 124 locale::locale(const locale& L) _STLP_NOTHROW
michael@0 125 : _M_impl( _get_Locale_impl( L._M_impl ) )
michael@0 126 {}
michael@0 127
michael@0 128 void locale::_M_insert(facet* f, locale::id& n) {
michael@0 129 if (f)
michael@0 130 _M_impl->insert(f, _Stl_loc_get_index(n));
michael@0 131 }
michael@0 132
michael@0 133 locale::locale( _Locale_impl* impl ) :
michael@0 134 _M_impl( _get_Locale_impl( impl ) )
michael@0 135 {}
michael@0 136
michael@0 137 // Create a locale from a name.
michael@0 138 locale::locale(const char* name)
michael@0 139 : _M_impl(0) {
michael@0 140 if (!name)
michael@0 141 _M_throw_on_null_name();
michael@0 142
michael@0 143 if (is_C_locale_name(name)) {
michael@0 144 _M_impl = _get_Locale_impl( locale::classic()._M_impl );
michael@0 145 return;
michael@0 146 }
michael@0 147
michael@0 148 _Locale_impl* impl = 0;
michael@0 149 _STLP_TRY {
michael@0 150 impl = new _Locale_impl(locale::id::_S_max, name);
michael@0 151
michael@0 152 // Insert categories one at a time.
michael@0 153 _Locale_name_hint *hint = 0;
michael@0 154 const char* ctype_name = name;
michael@0 155 char ctype_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 156 const char* numeric_name = name;
michael@0 157 char numeric_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 158 const char* time_name = name;
michael@0 159 char time_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 160 const char* collate_name = name;
michael@0 161 char collate_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 162 const char* monetary_name = name;
michael@0 163 char monetary_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 164 const char* messages_name = name;
michael@0 165 char messages_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 166 hint = impl->insert_ctype_facets(ctype_name, ctype_buf, hint);
michael@0 167 hint = impl->insert_numeric_facets(numeric_name, numeric_buf, hint);
michael@0 168 hint = impl->insert_time_facets(time_name, time_buf, hint);
michael@0 169 hint = impl->insert_collate_facets(collate_name, collate_buf, hint);
michael@0 170 hint = impl->insert_monetary_facets(monetary_name, monetary_buf, hint);
michael@0 171 impl->insert_messages_facets(messages_name, messages_buf, hint);
michael@0 172
michael@0 173 // Try to use a normalize locale name in order to have the == operator
michael@0 174 // to behave correctly:
michael@0 175 if (strcmp(ctype_name, numeric_name) == 0 &&
michael@0 176 strcmp(ctype_name, time_name) == 0 &&
michael@0 177 strcmp(ctype_name, collate_name) == 0 &&
michael@0 178 strcmp(ctype_name, monetary_name) == 0 &&
michael@0 179 strcmp(ctype_name, messages_name) == 0) {
michael@0 180 impl->name = ctype_name;
michael@0 181 }
michael@0 182 // else we keep current name.
michael@0 183
michael@0 184 // reassign impl
michael@0 185 _M_impl = _get_Locale_impl( impl );
michael@0 186 }
michael@0 187 _STLP_UNWIND(delete impl);
michael@0 188 }
michael@0 189
michael@0 190 static void _Stl_loc_combine_names_aux(_Locale_impl* L,
michael@0 191 const char* name,
michael@0 192 const char* ctype_name, const char* time_name, const char* numeric_name,
michael@0 193 const char* collate_name, const char* monetary_name, const char* messages_name,
michael@0 194 locale::category c) {
michael@0 195 // This function is only called when names has been validated so using _Locale_extract_*_name
michael@0 196 // can't fail.
michael@0 197 int __err_code;
michael@0 198 char buf[_Locale_MAX_SIMPLE_NAME];
michael@0 199 L->name = string("LC_CTYPE=") + _Locale_extract_ctype_name((c & locale::ctype) ? ctype_name : name, buf, 0, &__err_code) + ";";
michael@0 200 L->name += string("LC_TIME=") + _Locale_extract_time_name((c & locale::time) ? time_name : name, buf, 0, &__err_code) + ";";
michael@0 201 L->name += string("LC_NUMERIC=") + _Locale_extract_numeric_name((c & locale::numeric) ? numeric_name : name, buf, 0, &__err_code) + ";";
michael@0 202 L->name += string("LC_COLLATE=") + _Locale_extract_collate_name((c & locale::collate) ? collate_name : name, buf, 0, &__err_code) + ";";
michael@0 203 L->name += string("LC_MONETARY=") + _Locale_extract_monetary_name((c & locale::monetary) ? monetary_name : name, buf, 0, &__err_code) + ";";
michael@0 204 L->name += string("LC_MESSAGES=") + _Locale_extract_messages_name((c & locale::messages) ? messages_name : name, buf, 0, &__err_code);
michael@0 205 }
michael@0 206
michael@0 207 // Give L a name where all facets except those in category c
michael@0 208 // are taken from name1, and those in category c are taken from name2.
michael@0 209 static void _Stl_loc_combine_names(_Locale_impl* L,
michael@0 210 const char* name1, const char* name2,
michael@0 211 locale::category c) {
michael@0 212 if ((c & locale::all) == 0 || strcmp(name1, name1) == 0)
michael@0 213 L->name = name1;
michael@0 214 else if ((c & locale::all) == locale::all)
michael@0 215 L->name = name2;
michael@0 216 else {
michael@0 217 _Stl_loc_combine_names_aux(L, name1, name2, name2, name2, name2, name2, name2, c);
michael@0 218 }
michael@0 219 }
michael@0 220
michael@0 221 static void _Stl_loc_combine_names(_Locale_impl* L,
michael@0 222 const char* name,
michael@0 223 const char* ctype_name, const char* time_name, const char* numeric_name,
michael@0 224 const char* collate_name, const char* monetary_name, const char* messages_name,
michael@0 225 locale::category c) {
michael@0 226 if ((c & locale::all) == 0 || (strcmp(name, ctype_name) == 0 &&
michael@0 227 strcmp(name, time_name) == 0 &&
michael@0 228 strcmp(name, numeric_name) == 0 &&
michael@0 229 strcmp(name, collate_name) == 0 &&
michael@0 230 strcmp(name, monetary_name) == 0 &&
michael@0 231 strcmp(name, messages_name) == 0))
michael@0 232 L->name = name;
michael@0 233 else if ((c & locale::all) == locale::all && strcmp(ctype_name, time_name) == 0 &&
michael@0 234 strcmp(ctype_name, numeric_name) == 0 &&
michael@0 235 strcmp(ctype_name, collate_name) == 0 &&
michael@0 236 strcmp(ctype_name, monetary_name) == 0 &&
michael@0 237 strcmp(ctype_name, messages_name) == 0)
michael@0 238 L->name = ctype_name;
michael@0 239 else {
michael@0 240 _Stl_loc_combine_names_aux(L, name, ctype_name, time_name, numeric_name, collate_name, monetary_name, messages_name, c);
michael@0 241 }
michael@0 242 }
michael@0 243
michael@0 244
michael@0 245 // Create a locale that's a copy of L, except that all of the facets
michael@0 246 // in category c are instead constructed by name.
michael@0 247 locale::locale(const locale& L, const char* name, locale::category c)
michael@0 248 : _M_impl(0) {
michael@0 249 if (!name)
michael@0 250 _M_throw_on_null_name();
michael@0 251
michael@0 252 if (!::strcmp(_Nameless, name))
michael@0 253 _STLP_THROW(runtime_error("Invalid locale name '" _NAMELESS "'"));
michael@0 254
michael@0 255 _Locale_impl* impl = 0;
michael@0 256
michael@0 257 _STLP_TRY {
michael@0 258 impl = new _Locale_impl(*L._M_impl);
michael@0 259
michael@0 260 _Locale_name_hint *hint = 0;
michael@0 261 const char* ctype_name = name;
michael@0 262 char ctype_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 263 const char* numeric_name = name;
michael@0 264 char numeric_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 265 const char* time_name = name;
michael@0 266 char time_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 267 const char* collate_name = name;
michael@0 268 char collate_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 269 const char* monetary_name = name;
michael@0 270 char monetary_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 271 const char* messages_name = name;
michael@0 272 char messages_buf[_Locale_MAX_SIMPLE_NAME];
michael@0 273 if (c & locale::ctype)
michael@0 274 hint = impl->insert_ctype_facets(ctype_name, ctype_buf, hint);
michael@0 275 if (c & locale::numeric)
michael@0 276 hint = impl->insert_numeric_facets(numeric_name, numeric_buf, hint);
michael@0 277 if (c & locale::time)
michael@0 278 hint = impl->insert_time_facets(time_name, time_buf, hint);
michael@0 279 if (c & locale::collate)
michael@0 280 hint = impl->insert_collate_facets(collate_name, collate_buf, hint);
michael@0 281 if (c & locale::monetary)
michael@0 282 hint = impl->insert_monetary_facets(monetary_name, monetary_buf,hint);
michael@0 283 if (c & locale::messages)
michael@0 284 impl->insert_messages_facets(messages_name, messages_buf, hint);
michael@0 285
michael@0 286 _Stl_loc_combine_names(impl, L._M_impl->name.c_str(),
michael@0 287 ctype_name, time_name, numeric_name,
michael@0 288 collate_name, monetary_name, messages_name, c);
michael@0 289 _M_impl = _get_Locale_impl( impl );
michael@0 290 }
michael@0 291 _STLP_UNWIND(delete impl)
michael@0 292 }
michael@0 293
michael@0 294 // Contruct a new locale where all facets that aren't in category c
michael@0 295 // come from L1, and all those that are in category c come from L2.
michael@0 296 locale::locale(const locale& L1, const locale& L2, category c)
michael@0 297 : _M_impl(0) {
michael@0 298 _Locale_impl* impl = new _Locale_impl(*L1._M_impl);
michael@0 299
michael@0 300 _Locale_impl* i2 = L2._M_impl;
michael@0 301
michael@0 302 if (L1.name() != _Nameless && L2.name() != _Nameless)
michael@0 303 _Stl_loc_combine_names(impl, L1._M_impl->name.c_str(), L2._M_impl->name.c_str(), c);
michael@0 304 else {
michael@0 305 impl->name = _Nameless;
michael@0 306 }
michael@0 307
michael@0 308 if (c & collate) {
michael@0 309 impl->insert( i2, _STLP_STD::collate<char>::id);
michael@0 310 # ifndef _STLP_NO_WCHAR_T
michael@0 311 impl->insert( i2, _STLP_STD::collate<wchar_t>::id);
michael@0 312 # endif
michael@0 313 }
michael@0 314 if (c & ctype) {
michael@0 315 impl->insert( i2, _STLP_STD::ctype<char>::id);
michael@0 316 impl->insert( i2, _STLP_STD::codecvt<char, char, mbstate_t>::id);
michael@0 317 # ifndef _STLP_NO_WCHAR_T
michael@0 318 impl->insert( i2, _STLP_STD::ctype<wchar_t>::id);
michael@0 319 impl->insert( i2, _STLP_STD::codecvt<wchar_t, char, mbstate_t>::id);
michael@0 320 # endif
michael@0 321 }
michael@0 322 if (c & monetary) {
michael@0 323 impl->insert( i2, _STLP_STD::moneypunct<char, true>::id);
michael@0 324 impl->insert( i2, _STLP_STD::moneypunct<char, false>::id);
michael@0 325 impl->insert( i2, _STLP_STD::money_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
michael@0 326 impl->insert( i2, _STLP_STD::money_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
michael@0 327 # ifndef _STLP_NO_WCHAR_T
michael@0 328 impl->insert( i2, _STLP_STD::moneypunct<wchar_t, true>::id);
michael@0 329 impl->insert( i2, _STLP_STD::moneypunct<wchar_t, false>::id);
michael@0 330 impl->insert( i2, _STLP_STD::money_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 331 impl->insert( i2, _STLP_STD::money_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 332 # endif
michael@0 333 }
michael@0 334 if (c & numeric) {
michael@0 335 impl->insert( i2, _STLP_STD::numpunct<char>::id);
michael@0 336 impl->insert( i2, _STLP_STD::num_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
michael@0 337 impl->insert( i2, _STLP_STD::num_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
michael@0 338 # ifndef _STLP_NO_WCHAR_T
michael@0 339 impl->insert( i2, _STLP_STD::numpunct<wchar_t>::id);
michael@0 340 impl->insert( i2, _STLP_STD::num_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 341 impl->insert( i2, _STLP_STD::num_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 342 # endif
michael@0 343 }
michael@0 344 if (c & time) {
michael@0 345 impl->insert( i2, _STLP_STD::time_get<char, istreambuf_iterator<char, char_traits<char> > >::id);
michael@0 346 impl->insert( i2, _STLP_STD::time_put<char, ostreambuf_iterator<char, char_traits<char> > >::id);
michael@0 347 # ifndef _STLP_NO_WCHAR_T
michael@0 348 impl->insert( i2, _STLP_STD::time_get<wchar_t, istreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 349 impl->insert( i2, _STLP_STD::time_put<wchar_t, ostreambuf_iterator<wchar_t, char_traits<wchar_t> > >::id);
michael@0 350 # endif
michael@0 351 }
michael@0 352 if (c & messages) {
michael@0 353 impl->insert( i2, _STLP_STD::messages<char>::id);
michael@0 354 # ifndef _STLP_NO_WCHAR_T
michael@0 355 impl->insert( i2, _STLP_STD::messages<wchar_t>::id);
michael@0 356 # endif
michael@0 357 }
michael@0 358 _M_impl = _get_Locale_impl( impl );
michael@0 359 }
michael@0 360
michael@0 361 // Destructor.
michael@0 362 locale::~locale() _STLP_NOTHROW {
michael@0 363 if (_M_impl)
michael@0 364 _release_Locale_impl(_M_impl);
michael@0 365 }
michael@0 366
michael@0 367 // Assignment operator. Much like the copy constructor: just a bit of
michael@0 368 // pointer twiddling.
michael@0 369 const locale& locale::operator=(const locale& L) _STLP_NOTHROW {
michael@0 370 if (this->_M_impl != L._M_impl) {
michael@0 371 if (this->_M_impl)
michael@0 372 _release_Locale_impl(this->_M_impl);
michael@0 373 this->_M_impl = _get_Locale_impl(L._M_impl);
michael@0 374 }
michael@0 375 return *this;
michael@0 376 }
michael@0 377
michael@0 378 locale::facet* locale::_M_get_facet(const locale::id& n) const {
michael@0 379 return n._M_index < _M_impl->size() ? _M_impl->facets_vec[n._M_index] : 0;
michael@0 380 }
michael@0 381
michael@0 382 locale::facet* locale::_M_use_facet(const locale::id& n) const {
michael@0 383 locale::facet* f = (n._M_index < _M_impl->size() ? _M_impl->facets_vec[n._M_index] : 0);
michael@0 384 if (!f)
michael@0 385 _M_impl->_M_throw_bad_cast();
michael@0 386 return f;
michael@0 387 }
michael@0 388
michael@0 389 string locale::name() const {
michael@0 390 return _M_impl->name;
michael@0 391 }
michael@0 392
michael@0 393 // Compare two locales for equality.
michael@0 394 bool locale::operator==(const locale& L) const {
michael@0 395 return this->_M_impl == L._M_impl ||
michael@0 396 (this->name() == L.name() && this->name() != _Nameless);
michael@0 397 }
michael@0 398
michael@0 399 bool locale::operator!=(const locale& L) const {
michael@0 400 return !(*this == L);
michael@0 401 }
michael@0 402
michael@0 403 // static data members.
michael@0 404
michael@0 405 const locale& _STLP_CALL locale::classic() {
michael@0 406 return *_Stl_get_classic_locale();
michael@0 407 }
michael@0 408
michael@0 409 #if !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
michael@0 410 locale _STLP_CALL locale::global(const locale& L) {
michael@0 411 #else
michael@0 412 _Locale_impl* _STLP_CALL locale::global(const locale& L) {
michael@0 413 #endif
michael@0 414 locale old(_Stl_get_global_locale()->_M_impl);
michael@0 415 if (_Stl_get_global_locale()->_M_impl != L._M_impl) {
michael@0 416 _release_Locale_impl(_Stl_get_global_locale()->_M_impl);
michael@0 417 // this assign should be atomic, should be fixed here:
michael@0 418 _Stl_get_global_locale()->_M_impl = _get_Locale_impl(L._M_impl);
michael@0 419
michael@0 420 // Set the global C locale, if appropriate.
michael@0 421 #if !defined(_STLP_NO_LOCALE_SUPPORT)
michael@0 422 if (L.name() != _Nameless)
michael@0 423 setlocale(LC_ALL, L.name().c_str());
michael@0 424 #endif
michael@0 425 }
michael@0 426
michael@0 427 #if !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
michael@0 428 return old;
michael@0 429 #else
michael@0 430 return old._M_impl;
michael@0 431 #endif
michael@0 432 }
michael@0 433
michael@0 434 #if !defined (_STLP_STATIC_CONST_INIT_BUG) && !defined (_STLP_NO_STATIC_CONST_DEFINITION)
michael@0 435 const locale::category locale::none;
michael@0 436 const locale::category locale::collate;
michael@0 437 const locale::category locale::ctype;
michael@0 438 const locale::category locale::monetary;
michael@0 439 const locale::category locale::numeric;
michael@0 440 const locale::category locale::time;
michael@0 441 const locale::category locale::messages;
michael@0 442 const locale::category locale::all;
michael@0 443 #endif
michael@0 444
michael@0 445 _STLP_END_NAMESPACE
michael@0 446

mercurial