home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / src / locale_nonclassic.h < prev    next >
C/C++ Source or Header  |  2001-02-14  |  2KB  |  60 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_nonclassic_H
  20. #  define  LOCALE_nonclassic_H
  21.  
  22. # include "locale_impl.h"
  23.  
  24. _STLP_BEGIN_NAMESPACE
  25.  
  26. class _STLP_CLASS_DECLSPEC _Locale : public _Locale_impl, public _Refcount_Base
  27. {
  28. public:
  29.   _Locale(size_t n, const char* s) : _Locale_impl(s), _Refcount_Base(1), 
  30.     facets_vec(n, (void*)0 ) { facets = (locale::facet**)&facets_vec[0]; _M_size = n; }
  31.   _Locale(const _Locale_impl&);
  32.   ~_Locale();
  33.  
  34.   virtual void incr() { this->_M_incr(); }
  35.   virtual void decr() { this->_M_decr(); if (!this->_M_ref_count) delete this;}
  36.  
  37.   void remove(size_t index);
  38.   locale::facet* insert(locale::facet*, size_t index, bool do_incr);
  39.   void insert(_Locale_impl* from, const locale::id& n);
  40.  
  41. // Helper functions for byname construction of locales.
  42.   void insert_ctype_facets(const char* name);
  43.   void insert_numeric_facets(const char* name);
  44.   void insert_time_facets(const char* name);
  45.   void insert_collate_facets(const char* name);
  46.   void insert_monetary_facets(const char* name);
  47.   void insert_messages_facets(const char* name);
  48.   
  49.   vector<void*> facets_vec;
  50.  
  51.   static void _STLP_CALL _M_throw_bad_cast();
  52.  
  53. private:
  54.   void operator=(const _Locale_impl&);
  55. };
  56.  
  57. _STLP_END_NAMESPACE
  58.  
  59. #endif
  60.