home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / src / locale_impl.h < prev    next >
C/C++ Source or Header  |  2001-07-05  |  2KB  |  74 lines

  1. /*
  2.  * Copyright (c) 1999
  3.  * Silicon Graphics Computer Systems, Inc.
  4.  *
  5.  * Copyright (c) 1999 
  6.  * Boris Fomitchev
  7.  *
  8.  * This material is provided "as is", with absolutely no warranty expressed
  9.  * or implied. Any use is at your own risk.
  10.  *
  11.  * Permission to use or copy this software for any purpose is hereby granted 
  12.  * without fee, provided the above notices are retained on all copies.
  13.  * Permission to modify the code and to distribute modified code is granted,
  14.  * provided the above notices are retained, and a notice that the code was
  15.  * modified is included with the above copyright notice.
  16.  *
  17.  */ 
  18.  
  19. # ifndef LOCALE_IMPL_H
  20. #  define  LOCALE_IMPL_H
  21.  
  22. #include <clocale>             // C locale header file.
  23. #include <vector>
  24. #include <string>
  25. #include <stl/_locale.h>
  26. #include "c_locale.h"
  27.  
  28. _STLP_BEGIN_NAMESPACE
  29.  
  30. //----------------------------------------------------------------------
  31. // Class _Locale_impl
  32. // This is the base class which implements access only and is supposed to 
  33. // be used for classic locale only
  34. class _STLP_CLASS_DECLSPEC _Locale_impl
  35. {
  36. public:
  37.   _Locale_impl(const char* s);
  38.   //  _Locale_impl(const _Locale_impl&);
  39.   virtual ~_Locale_impl();
  40.  
  41.   virtual void incr();
  42.   virtual void decr();
  43.  
  44.   size_t size() const { return _M_size; }
  45.  
  46.   static _Locale_impl* make_classic_locale();
  47.   
  48.   locale::facet** facets;
  49.   size_t _M_size;
  50.  
  51.   basic_string<char, char_traits<char>, allocator<char> > name;
  52.  
  53.   static void _STLP_CALL _M_throw_bad_cast();
  54.  
  55. private:
  56.   void operator=(const _Locale_impl&);
  57. };
  58.  
  59. inline _Locale_impl*  _STLP_CALL _S_copy_impl(_Locale_impl* I) {
  60.     _STLP_ASSERT( I != 0 );
  61.     I->incr();
  62.     return I;
  63. }
  64.  
  65. extern _Locale_impl*   _Stl_loc_global_impl;
  66. // extern locale*         _Stl_loc_classic_locale;
  67. extern _STLP_STATIC_MUTEX _Stl_loc_global_locale_lock;
  68.  
  69. _STLP_END_NAMESPACE
  70.  
  71. #endif
  72.  
  73.  
  74.