os/ossrv/genericopenlibs/cppstdlib/stl/src/locale_impl.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/src/locale_impl.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,134 @@
     1.4 +/*
     1.5 + * Copyright (c) 1999
     1.6 + * Silicon Graphics Computer Systems, Inc.
     1.7 + *
     1.8 + * Copyright (c) 1999
     1.9 + * Boris Fomitchev
    1.10 + *
    1.11 + * This material is provided "as is", with absolutely no warranty expressed
    1.12 + * or implied. Any use is at your own risk.
    1.13 + *
    1.14 + * Permission to use or copy this software for any purpose is hereby granted
    1.15 + * without fee, provided the above notices are retained on all copies.
    1.16 + * Permission to modify the code and to distribute modified code is granted,
    1.17 + * provided the above notices are retained, and a notice that the code was
    1.18 + * modified is included with the above copyright notice.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +#ifndef LOCALE_IMPL_H
    1.23 +#define LOCALE_IMPL_H
    1.24 +
    1.25 +#include <clocale>             // C locale header file.
    1.26 +#include <vector>
    1.27 +#include <string>
    1.28 +#include <locale>
    1.29 +#include "c_locale.h"
    1.30 +
    1.31 +_STLP_BEGIN_NAMESPACE
    1.32 +
    1.33 +#if defined (_STLP_USE_TEMPLATE_EXPORT)
    1.34 +//Export of _Locale_impl facets container:
    1.35 +#  if !defined (_STLP_USE_PTR_SPECIALIZATIONS)
    1.36 +//If we are using pointer specialization, vector<locale::facet*> will use
    1.37 +//the already exported vector<void*> implementation.
    1.38 +_STLP_EXPORT_TEMPLATE_CLASS allocator<locale::facet*>;
    1.39 +
    1.40 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.41 +
    1.42 +_STLP_EXPORT_TEMPLATE_CLASS _STLP_alloc_proxy<locale::facet**, locale::facet*, allocator<locale::facet*> >;
    1.43 +_STLP_EXPORT_TEMPLATE_CLASS _Vector_base<locale::facet*, allocator<locale::facet*> >;
    1.44 +
    1.45 +_STLP_MOVE_TO_STD_NAMESPACE
    1.46 +#  endif
    1.47 +#  if defined (_STLP_DEBUG)
    1.48 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.49 +#    define _STLP_NON_DBG_VECTOR _STLP_NON_DBG_NAME(vector)
    1.50 +_STLP_EXPORT_TEMPLATE_CLASS __construct_checker<_STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> > >;
    1.51 +_STLP_EXPORT_TEMPLATE_CLASS _STLP_NON_DBG_VECTOR<locale::facet*, allocator<locale::facet*> >;
    1.52 +#    undef _STLP_NON_DBG_VECTOR
    1.53 +_STLP_MOVE_TO_STD_NAMESPACE
    1.54 +#  endif
    1.55 +
    1.56 +_STLP_EXPORT_TEMPLATE_CLASS vector<locale::facet*, allocator<locale::facet*> >;
    1.57 +#endif
    1.58 +
    1.59 +//----------------------------------------------------------------------
    1.60 +// Class _Locale_impl
    1.61 +// This is the base class which implements access only and is supposed to
    1.62 +// be used for classic locale only
    1.63 +class _STLP_CLASS_DECLSPEC _Locale_impl : public _Refcount_Base {
    1.64 +  public:
    1.65 +    _Locale_impl(const char* s);
    1.66 +    _Locale_impl(const _Locale_impl&);
    1.67 +    _Locale_impl(size_t n, const char* s);
    1.68 +
    1.69 +  private:
    1.70 +    ~_Locale_impl();
    1.71 +
    1.72 +  public:
    1.73 +    size_t size() const { return facets_vec.size(); }
    1.74 +
    1.75 +    basic_string<char, char_traits<char>, allocator<char> > name;
    1.76 +
    1.77 +    static void _STLP_FUNCTION_THROWS _STLP_CALL _M_throw_bad_cast();
    1.78 +
    1.79 +  private:
    1.80 +    void operator=(const _Locale_impl&);
    1.81 +
    1.82 +  public:
    1.83 +    class _STLP_CLASS_DECLSPEC Init {
    1.84 +      public:
    1.85 +        Init();
    1.86 +        ~Init();
    1.87 +      private:
    1.88 +        _Refcount_Base& _M_count() const;
    1.89 +    };
    1.90 +
    1.91 +    static void _STLP_CALL _S_initialize();
    1.92 +    static void _STLP_CALL _S_uninitialize();
    1.93 +
    1.94 +    static void make_classic_locale();
    1.95 +    static void free_classic_locale();
    1.96 +
    1.97 +    friend class Init;
    1.98 +
    1.99 +  public: // _Locale
   1.100 +    // void remove(size_t index);
   1.101 +    locale::facet* insert(locale::facet*, size_t index);
   1.102 +    void insert(_Locale_impl* from, const locale::id& n);
   1.103 +
   1.104 +    // Helper functions for byname construction of locales.
   1.105 +    _Locale_name_hint* insert_ctype_facets(const char* name, _Locale_name_hint* hint);
   1.106 +    _Locale_name_hint* insert_numeric_facets(const char* name, _Locale_name_hint* hint);
   1.107 +    _Locale_name_hint* insert_time_facets(const char* name, _Locale_name_hint* hint);
   1.108 +    _Locale_name_hint* insert_collate_facets(const char* name, _Locale_name_hint* hint);
   1.109 +    _Locale_name_hint* insert_monetary_facets(const char* name, _Locale_name_hint* hint);
   1.110 +    _Locale_name_hint* insert_messages_facets(const char* name, _Locale_name_hint* hint);
   1.111 +
   1.112 +    bool operator != (const locale& __loc) const { return __loc._M_impl != this; }
   1.113 +
   1.114 +  private:
   1.115 +    vector<locale::facet*> facets_vec;
   1.116 +
   1.117 +  private:
   1.118 +    friend _Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl * );
   1.119 +    friend  _STLP_IMPORT_DECLSPEC  _Locale_impl * _STLP_CALL _copy_Nameless_Locale_impl( _Locale_impl * );
   1.120 +    friend void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc );
   1.121 +#if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
   1.122 +    friend class _STLP_NO_MEM_T_NAME(loc);
   1.123 +#else
   1.124 +    friend class locale;
   1.125 +#endif
   1.126 +};
   1.127 +
   1.128 +void _STLP_CALL _release_Locale_impl( _Locale_impl *& loc );
   1.129 +_Locale_impl * _STLP_CALL _copy_Locale_impl( _Locale_impl *loc );
   1.130 +
   1.131 +_STLP_END_NAMESPACE
   1.132 +
   1.133 +#endif
   1.134 +
   1.135 +// Local Variables:
   1.136 +// mode:C++
   1.137 +// End: