⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locale_facets.h

📁 c++编程宝典源码及Quincy99编译器 是《标准C++编程宝典》电子工业出版社的光盘
💻 H
📖 第 1 页 / 共 4 页
字号:
	  ios_base::iostate& __err, double& __v) const      { return do_get(__in, __end, __io, __err, __v); }      iter_type       get(iter_type __in, iter_type __end, ios_base& __io,	  ios_base::iostate& __err, long double& __v) const      { return do_get(__in, __end, __io, __err, __v); }      iter_type       get(iter_type __in, iter_type __end, ios_base& __io,	  ios_base::iostate& __err, void*& __v) const      { return do_get(__in, __end, __io, __err, __v); }            static locale::id id;    protected:      virtual ~num_get() { }      // This consolidates the extraction, storage and      // error-processing parts of the do_get(...) overloaded member      // functions. NB: this is specialized for char.      void       _M_extract(iter_type __beg, iter_type __end, ios_base& __io, 		 ios_base::iostate& __err, char* __xtrc, 		 int& __base, bool __fp = true) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, short&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, int&) const;#endif      virtual iter_type       do_get (iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const;#ifdef _GLIBCPP_USE_LONG_LONG       virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, 	     long long&) const;#endif      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, 	      unsigned short&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&,	      ios_base::iostate& __err, unsigned int&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&,	      ios_base::iostate& __err, unsigned long&) const;#ifdef _GLIBCPP_USE_LONG_LONG       virtual iter_type       do_get(iter_type, iter_type, ios_base&,	     ios_base::iostate& __err, unsigned long long&) const;#endif      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, 	     float&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, 	     double&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&, 	     ios_base::iostate& __err, long double&) const;      virtual iter_type       do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err, 	     void*&) const;    };  // Declare specialized extraction member function.  template<>    void    num_get<char, istreambuf_iterator<char> >::        _M_extract(istreambuf_iterator<char> __beg, 	       istreambuf_iterator<char> __end, ios_base& __io, 	       ios_base::iostate& __err, char* __xtrc, 	       int& __base, bool __fp) const;  // _Numeric_put is used by num_put, money_put, and time_put  //   to help in formatting out numbers.  template<typename _CharT, typename _OutIter>    class _Numeric_put    {      typedef _CharT      char_type;      typedef _OutIter    iter_type;    protected:      explicit       _Numeric_put() { }    protected:      virtual       ~_Numeric_put() { }    };  template<typename _CharT, typename _OutIter>    class num_put : public locale::facet    {      // Types:      typedef _CharT       char_type;      typedef _OutIter     iter_type;    public:      explicit       num_put(size_t __refs = 0) : locale::facet(__refs) { }      iter_type       put(iter_type __s, ios_base& __f, char_type __fill, bool __v) const      { return do_put(__s, __f, __fill, __v); }      iter_type       put (iter_type __s, ios_base& __f, char_type __fill, long __v) const      { return do_put(__s, __f, __fill, __v); }#ifdef _GLIBCPP_USE_LONG_LONG       iter_type       put(iter_type __s, ios_base& __f, char_type __fill, long long __v) const      { return do_put(__s, __f, __fill, __v); }#endif      iter_type       put(iter_type __s, ios_base& __f, char_type __fill, 	  unsigned long __v) const      { return do_put(__s, __f, __fill, __v); }      iter_type       put(iter_type __s, ios_base& __f, char_type __fill, double __v) const      { return do_put(__s, __f, __fill, __v); }      iter_type       put(iter_type __s, ios_base& __f, char_type __fill, 	  long double __v) const      { return do_put(__s, __f, __fill, __v); }      iter_type       put(iter_type __s, ios_base& __f, char_type __fill, 	  const void* __v) const      { return do_put(__s, __f, __fill, __v); }      static locale::id id;    protected:      virtual       ~num_put() { };      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, bool __v) const;      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, long __v) const;#ifdef _GLIBCPP_USE_LONG_LONG       virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, long long __v) const;#endif      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, unsigned long) const;      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, double __v) const;      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, long double __v) const;      virtual iter_type       do_put(iter_type, ios_base&, char_type __fill, const void* __v) const;    };  template<typename _CharT>    class _Punct : public locale::facet    {      // Types:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;    public:      char_type          decimal_point() const      { return do_decimal_point(); }      char_type          thousands_sep() const      { return do_thousands_sep(); }      string             grouping() const      { return do_grouping(); }    protected:      explicit       _Punct(size_t __refs = 0) : locale::facet(__refs) { }      virtual       ~_Punct() { }      virtual char_type          do_decimal_point() const      { return _M_decimal_point; }      virtual char_type          do_thousands_sep() const      { return _M_thousands_sep; }      virtual string             do_grouping() const      { return _M_grouping; }    private:      char_type _M_decimal_point;      char_type _M_thousands_sep;      string    _M_grouping;          protected:      // for use at construction time only:      void       _M_init(char_type __d, char_type __t, const string& __g)      {	_M_decimal_point = __d;	_M_thousands_sep = __t;	_M_grouping = __g;      }    };  template<typename _CharT>    class _Numpunct : public _Punct<_CharT>    {      // Types:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;    public:      string_type        truename() const      { return do_truename(); }      string_type        falsename() const      { return do_falsename(); }    protected:      explicit       _Numpunct(size_t __refs = 0) : _Punct<_CharT> (__refs) { }      virtual       ~_Numpunct() { }      virtual string_type        do_truename() const      { return _M_truename; }      virtual string_type        do_falsename() const      { return _M_falsename; }    private:      string_type _M_truename;      string_type _M_falsename;          protected:      // For use only during construction      void       _M_init_boolnames(const string_type& __t, const string_type& __f)      {	_M_truename = __t;	_M_falsename = __f;      }	    };  template<typename _CharT>    class numpunct : public _Numpunct<_CharT>    {    public:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;      static locale::id id;      explicit       numpunct(size_t __refs = 0) : _Numpunct<_CharT>(__refs) { }    protected:      virtual       ~numpunct() { }    };  template<>     numpunct<char>::numpunct(size_t __refs): _Numpunct<char>(__refs)    {      _M_init('.', ',', "");      _M_init_boolnames("false", "true");    }#ifdef _GLIBCPP_USE_WCHAR_T  template<>     numpunct<wchar_t>::numpunct(size_t __refs): _Numpunct<wchar_t>(__refs)    {      _M_init(L'.', L',', "");      _M_init_boolnames(L"false", L"true");    }#endif  template<typename _CharT>    class numpunct_byname : public numpunct<_CharT>    {    public:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;      explicit       numpunct_byname(const char*, size_t __refs = 0)      : numpunct<_CharT> (__refs) { }          protected:      virtual       ~numpunct_byname() { }    };  template<>    numpunct_byname<char>::numpunct_byname(const char*, size_t __refs);#ifdef _GLIBCPP_USE_WCHAR_T  template<>    numpunct_byname<wchar_t>::numpunct_byname(const char*, size_t __refs);#endif  template<typename _CharT>    class _Collate : public locale::facet    {      // Types:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;    public:      int       compare(const _CharT* __lo1, const _CharT* __hi1,	      const _CharT* __lo2, const _CharT* __hi2) const      { return do_compare(__lo1, __hi1, __lo2, __hi2); }      string_type       transform(const _CharT* __lo, const _CharT* __hi) const      { return do_transform(__lo, __hi); }      long       hash(const _CharT* __lo, const _CharT* __hi) const      { return do_hash(__lo, __hi); }        protected:      explicit       _Collate(size_t __refs = 0) : locale::facet(__refs) { }      ~_Collate() { } // virtual      virtual int        do_compare(const _CharT* __lo1, const _CharT* __hi1,		 const _CharT* __lo2, const _CharT* __hi2) const = 0;      virtual string_type       do_transform(const _CharT* __lo, const _CharT* __hi) const = 0;      virtual long         do_hash(const _CharT* __lo, const _CharT* __hi) const = 0;    };  template<typename _CharT>    class collate : public _Collate<_CharT>    {      // Types:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;    public:            explicit       collate(size_t __refs = 0) : _Collate<_CharT> (__refs) { }      static locale::id id;          protected:      virtual       ~collate() { }    };  template<>    class collate<char> : public _Collate<char>    {      // Types:      typedef char               char_type;      typedef basic_string<char> string_type;    public:            explicit       collate(size_t __refs = 0);      static locale::id id;          protected:      virtual       ~collate();      virtual int        do_compare(const char* __lo1, const char* __hi1,		 const char* __lo2, const char* __hi2) const;      virtual string_type       do_transform(const char* __lo, const char* __hi) const;      virtual long         do_hash(const char* __lo, const char* __hi) const;    };#ifdef _GLIBCPP_USE_WCHAR_T  template<>    class collate<wchar_t> : public _Collate<wchar_t>    {      // Types:      typedef wchar_t               char_type;      typedef basic_string<wchar_t> string_type;          public:      explicit       collate(size_t __refs = 0);      static locale::id id;          protected:      virtual       ~collate();      virtual int         do_compare(const wchar_t* __lo1, const wchar_t* __hi1,		 const wchar_t* __lo2, const wchar_t* __hi2) const;      virtual string_type       do_transform(const wchar_t* __lo, const wchar_t* __hi) const;      virtual long         do_hash(const wchar_t* __lo, const wchar_t* __hi) const;    };#endif  template<typename _CharT>    class collate_byname : public collate<_CharT>    {      // Types:      typedef _CharT               char_type;      typedef basic_string<_CharT> string_type;    public:      explicit       collate_byname(const char*, size_t __refs = 0);    protected:      virtual       ~collate_byname() { }    };  template<>    collate_byname<char>::collate_byname(const char*, size_t __refs);#ifdef _GLIBCPP_USE_WCHAR_T  template<>    collate_byname<wchar_t>::collate_byname (const char*, size_t __refs);#endif  class time_base  {  public:    enum dateorder { no_order, dmy, mdy, ymd, ydm };  };  template<typename _CharT, typename _InIter>    class time_get : public locale::facet, public time_base    {      // Types:      typedef _CharT     char_type;      typedef _InIter    iter_type;    public:      explicit       time_get(size_t __refs = 0)       : locale::facet (__refs), _M_daynames(0), _M_monthnames(0) { }      dateorder       date_order()  const      { return do_date_order(); }      iter_type       get_time(iter_type __s, iter_type __end, ios_base& __f, 	       ios_base::iostate& __err, tm* __t)  const      { return do_get_time(__s, __end, __f, __err, __t); }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -