home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / Rw / numbrw.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  20.3 KB  |  590 lines

  1. #ifndef __NUMBRW_H
  2. #define __NUMBRW_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -A- -w-inl -w-aus -w-sig
  4. // -*- C++ -*-
  5. /****************************************************************************
  6.  *
  7.  * rw/numbrw - Internal classes for numeric formatting and parsing.
  8.  *
  9.  ***************************************************************************
  10.  *
  11.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  12.  *
  13.  * This computer software is owned by Rogue Wave Software, Inc. and is
  14.  * protected by U.S. copyright laws and other laws and by international
  15.  * treaties.  This computer software is furnished by Rogue Wave Software,
  16.  * Inc. pursuant to a written license agreement and may be used, copied,
  17.  * transmitted, and stored only in accordance with the terms of such
  18.  * license and with the inclusion of the above copyright notice.  This
  19.  * computer software or any other copies thereof may not be provided or
  20.  * otherwise made available to any other person.
  21.  *
  22.  * U.S. Government Restricted Rights.  This computer software is provided
  23.  * with Restricted Rights.  Use, duplication, or disclosure by the
  24.  * Government is subject to restrictions as set forth in subparagraph (c)
  25.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  26.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  27.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  28.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  29.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  30.  *
  31.  ***************************************************************************/
  32.  
  33. #ifndef __STD_RW_LOCNUMRW__
  34. #define __STD_RW_LOCNUMRW__
  35.  
  36. #ifndef _RWSTD_NO_NEW_HEADER
  37. #include <ctime>
  38. #else
  39. #include <time.h>
  40. #endif
  41.  
  42. #ifndef _RWSTD_NO_NAMESPACE
  43. namespace __rwstd {
  44. #endif
  45.  
  46. // -------------------------------------------------------
  47. // Implementation class template -- timepunct_init<charT>.
  48. // -------------------------------------------------------
  49.  
  50. // Structure used to initialize the private data members of timepunct<charT>.
  51. template <class charT>
  52. class _RWSTDExportTemplate timepunct_init
  53. {
  54. public:
  55.   const charT *dn_[7][2];       // Day names and abbreviations
  56.   const charT *mn_[12][2];      // Month names and abbreviations
  57.   const charT *ampm_[2];        // AM/PM strings
  58.   const charT *bad_;            // Bad value output signal
  59.   const charT *ord_[100];       // Ordinal numbers
  60.   const charT *pat_[6];         // Patterns for formats "xXcDrT" resp.
  61. };
  62.  
  63. template <class charT>
  64. class _RWSTDExport timepunct_loc;
  65.  
  66. _RWSTD_TEMPLATE
  67. class _RWSTDExport timepunct_loc<char> 
  68. {
  69.   typedef _RW_STD::basic_string<char,_RW_STD::char_traits<char>,_RW_STD::allocator<char> > string_type;
  70.   const timepunct_init<char>& ti_;
  71.  
  72.  public:
  73.   timepunct_loc (const timepunct_init<char> &i)
  74.     : ti_(i) 
  75.   {}
  76.  
  77.   const string_type get_day(int i, bool abbr) const;
  78.   const string_type get_month(int i, bool abbr) const;
  79.   const string_type get_ampm(bool afternoon) const;
  80.   const string_type get_bad() const  { return ti_.bad_; }
  81.   const string_type get_ord(int i) const { return ti_.ord_[i]; }
  82.   const string_type get_pattern(int i) const { return ti_.pat_[i]; }
  83. };
  84.  
  85. #ifndef _RWSTD_NO_WIDE_CHAR
  86. _RWSTD_TEMPLATE
  87. class _RWSTDExport timepunct_loc<wchar_t> 
  88. {
  89.   typedef _RW_STD::basic_string<wchar_t,_RW_STD::char_traits<wchar_t>,_RW_STD::allocator<wchar_t> > string_type;
  90.   const timepunct_init<wchar_t>& ti_;
  91.  
  92.  public:
  93.   timepunct_loc (const timepunct_init<wchar_t> &i)
  94.     : ti_(i) 
  95.   {}
  96.  
  97. #ifndef _RWSTD_NO_WSTR
  98.   const string_type get_day(int i, bool abbr) const;
  99.   const string_type get_month(int i, bool abbr) const;
  100.   const string_type get_ampm(bool afternoon) const;
  101. #else
  102.   const string_type get_day(int i, bool abbr) const { return ti_.dn_[i][abbr]; }
  103.   const string_type get_month(int i, bool abbr) const { return ti_.mn_[i][abbr]; }
  104.   const string_type get_ampm(bool afternoon) const { return ti_.ampm_[afternoon]; }
  105. #endif //  _RWSTD_NO_WSTR
  106.   const string_type get_bad() const  { return ti_.bad_; }
  107.   const string_type get_ord(int i) const { return ti_.ord_[i]; }
  108.   const string_type get_pattern(int i) const { return ti_.pat_[i]; }
  109. };
  110. #endif // _RWSTD_NO_WIDE_CHAR
  111. template <class charT>
  112. class _RWSTDExportTemplate timepunct_loc
  113. {
  114.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> > string_type;
  115.   const timepunct_init<charT>& ti_;
  116.  
  117.  public:
  118.   timepunct_loc (const timepunct_init<charT> &i)
  119.     : ti_(i) 
  120.   {}
  121.  
  122.   const string_type get_day(int i, bool abbr) const  { return ti_.dn_[i][abbr]; }
  123.   const string_type get_month(int i, bool abbr) const { return ti_.mn_[i][abbr]; }
  124.   const string_type get_ampm(bool afternoon) const { return ti_.ampm_[afternoon]; }
  125.   const string_type get_bad() const  { return ti_.bad_; }
  126.   const string_type get_ord(int i) const { return ti_.ord_[i]; }
  127.   const string_type get_pattern(int i) const { return ti_.pat_[i]; }
  128. };
  129.  
  130. // -------------------------------------------------------
  131. // Implementation class template -- timepunct_data<charT>.
  132. // -------------------------------------------------------
  133.  
  134. // timepunct<charT> derives from this (via rwstd::timepunct_impl) to get its
  135. // private data members.
  136.  
  137. template <class charT>
  138. class _RWSTDExportTemplate timepunct_data {
  139.   friend class timepunct<charT>;
  140.   friend class keyword_cracker<charT>;
  141.  public:
  142.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> > string_type;
  143.  private:
  144.  
  145.   string_type dn_[7][2];
  146.   string_type mn_[12][2];
  147.   string_type ampm_[2];
  148.   string_type bad_;
  149.   string_type ord_[100];
  150.   string_type pat_[6];
  151.  
  152.   keyword_def<charT> dn_defs_[7][2];
  153.   keyword_map<charT> dn_map_;
  154.   keyword_def<charT> mn_defs_[12][2];
  155.   keyword_map<charT> mn_map_;
  156.   keyword_def<charT> ampm_defs_[2];
  157.   keyword_map<charT> ampm_map_;
  158.  
  159.  protected:
  160.   timepunct_data (const timepunct_loc<charT> &i);
  161.   void __initpat (const locale*);
  162.   void __initfacet (const locale*);
  163. };
  164.  
  165. // -------------------------------------------------------
  166. // Implementation class template -- timepunct_impl<charT>.
  167. // -------------------------------------------------------
  168.  
  169. // timepunct<charT> derives from this to get the parts of its behavior that
  170. // must be specialized on the character type.  Currently the only specialized
  171. // behavior is the initialization logic in the constructor.
  172.  
  173. template <class charT>
  174. class _RWSTDExportTemplate timepunct_impl :
  175.     public timepunct_data<charT>
  176. {
  177.  protected:
  178.   timepunct_impl(void);
  179. };
  180.  
  181. _RWSTD_TEMPLATE
  182. class _RWSTDExport timepunct_impl<char>:                 // Specialization
  183.     public timepunct_data<char>
  184. {
  185. #if !defined(_MSC_VER) || defined(__BORLANDC__)
  186.   static _RWSTDExport timepunct_init<char> __ivals;      // Vendor-supplied
  187. #else
  188.   static timepunct_init<char> __ivals;
  189. #endif
  190.  
  191.  protected:
  192.   timepunct_impl (void):
  193.     timepunct_data<char>(timepunct_loc<char>(__ivals)) { }
  194. };
  195.  
  196. #ifndef _RWSTD_NO_WIDE_CHAR
  197. _RWSTD_TEMPLATE
  198. class _RWSTDExport timepunct_impl<wchar_t>:              // Specialization
  199.     public timepunct_data<wchar_t>
  200. {
  201. #if !defined(_MSC_VER) || defined(__BORLANDC__)
  202.   static _RWSTDExport timepunct_init<wchar_t> __ivals;   // Vendor-supplied
  203. #else
  204.   static timepunct_init<wchar_t> __ivals;
  205. #endif
  206.  
  207.  protected:
  208.   timepunct_impl(void):
  209.       timepunct_data<wchar_t>(timepunct_loc<wchar_t>(__ivals)) { }
  210. };
  211. #endif // _RWSTD_NO_WIDE_CHAR
  212. // ----------------------------------------------------
  213. // Time and date punctuation facet -- timepunct<charT>.
  214. // ----------------------------------------------------
  215.  
  216. template <class charT>
  217. class _RWSTDExportTemplate timepunct : public _RW_STD::locale::facet,
  218.     public timepunct_impl<charT>
  219. {
  220.  public:
  221.   typedef charT char_type;
  222.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> >
  223.     string_type;
  224.  
  225.   _EXPLICIT timepunct (size_t refs=0):
  226.       _RW_STD::locale::facet(refs,_RW_STD::locale::time) { }
  227.  
  228.   string_type dayname (int day, bool abbreviated) const
  229.       { return do_dayname(day,abbreviated); }
  230.   string_type monthname (int month, bool abbreviated) const
  231.       { return do_monthname(month,abbreviated); }
  232.   string_type ordinal (int number) const
  233.       { return do_ordinal(number); }
  234.  
  235.   static _RW_STD::locale::id id;
  236.  
  237.   // Implementation:
  238.   enum { __facet_cat = _RW_STD::locale::time, __ok_implicit = 1 };
  239.  
  240.  protected:
  241.   virtual ~timepunct() { }
  242.  
  243.   virtual string_type do_dayname (int day, bool abbreviated) const;
  244.   virtual string_type do_monthname (int month, bool abbreviated) const;
  245.   virtual string_type do_ordinal (int number) const;
  246.  
  247.  private:
  248.   void __initfacet (const locale*);
  249.  
  250.   #ifdef _RWSTD_NO_MEMBER_TEMPLATES
  251.   _RW_STD::locale::id &__get_id (void) const { return id; }
  252.   #endif
  253. };
  254. // --------------------------------------------------------
  255. // Implementation class template -- keyword_cracker<charT>.
  256. // --------------------------------------------------------
  257.  
  258. // Gives derived classes a backdoor way to get the private keyword_map and
  259. // other members out of numpunct and timepunct facets.
  260.  
  261. template <class charT>
  262. class _RWSTDExportTemplate keyword_cracker {
  263.  public:
  264.   static const keyword_map<charT>& get_tf_map
  265.       (const _RW_STD::numpunct<charT> &nump)
  266.       { return nump.tf_map_; }
  267.   static const keyword_map<charT>& get_day_map
  268.       (const timepunct<charT>& timp)
  269.       { return timp.dn_map_; }
  270.   static const keyword_map<charT>& get_month_map
  271.       (const timepunct<charT>& timp)
  272.       { return timp.mn_map_; }
  273.   static const keyword_map<charT>& get_ampm_map
  274.       (const timepunct<charT>& timp)
  275.       { return timp.ampm_map_; }
  276. #ifndef _RWSTD_NO_NAMESPACE
  277.   static const _TYPENAME _RW_STD::numpunct<charT>::string_type& get_tf_string
  278. #else
  279.   static const _TYPENAME numpunct<charT>::string_type& get_tf_string
  280. #endif
  281.       (const _RW_STD::numpunct<charT>& nump,bool v)
  282.       { return v? nump.tn_ : nump.fn_; }
  283.   static const _TYPENAME timepunct<charT>::string_type&
  284.       get_day_string
  285.       (const timepunct<charT>& timp,unsigned n,bool abbr)
  286.       { return n<7? timp.dn_[n][abbr] : timp.bad_; }
  287.   static const _TYPENAME timepunct<charT>::string_type&
  288.       get_month_string
  289.       (const timepunct<charT>& timp,unsigned n,bool abbr)
  290.       { return n<12? timp.mn_[n][abbr] : timp.bad_; }
  291.   static const _TYPENAME timepunct<charT>::string_type&
  292.       get_ampm_string
  293.       (const timepunct<charT>& timp,bool pm)
  294.       { return timp.ampm_[pm]; }
  295.   static const _TYPENAME timepunct<charT>::string_type&
  296.       get_ord_string
  297.       (const timepunct<charT>& timp,unsigned n)
  298.       { return n<99? timp.ord_[n] : timp.bad_; }
  299.   static const _TYPENAME timepunct<charT>::string_type&
  300.       get_patt_string
  301.       (const timepunct<charT>& timp,unsigned n)
  302.       { return n<6? timp.pat_[n] : timp.bad_; }
  303. };
  304.  
  305. // -------------------------------------------------------------
  306. // Implementation class template -- digit_handler_base_1<charT>.
  307. // -------------------------------------------------------------
  308.  
  309. // Contains charT-dependent functionality that is common to the digit_reader
  310. // and digit_writer classes, particularly related to getting access to ctype
  311. // and punct facets they both use.
  312.  
  313. template <class charT>
  314. class _RWSTDExportTemplate digit_handler_base_1:
  315.     public keyword_cracker<charT>
  316. {
  317.  public:
  318.   const _RW_STD::ctype<charT> &ctyp;
  319.   const digit_map<charT>& dmap;
  320.   const punct_data<charT>& punct;
  321.  
  322.   // Constructor for general numerics, gets punct from loc's numpunct facet.
  323.   digit_handler_base_1 (const _RW_STD::locale &loc);
  324.  
  325.   // Constructor for money, passed punct_data is in fact a moneypunct facet.
  326.   digit_handler_base_1 (const _RW_STD::locale &loc,const punct_data<charT>&);
  327. };
  328.  
  329. // ------------------------------------------
  330. // Implementation class -- digit_reader_base.
  331. // ------------------------------------------
  332.  
  333. // Contains digit_reader members that do not depend on the digit_reader
  334. // template parameters, particularly for converting strings of char digits
  335. // to long and floating-point binary values.
  336.  
  337. class _RWSTDExport digit_reader_base : public digit_map_base
  338. {
  339.  public:
  340.   enum {
  341.     good              = 0x0000,
  342.     no_digits         = 0x0001,
  343.     too_many_digits   = 0x0002,
  344.     too_many_groups   = 0x0004,
  345.     group_too_long    = 0x0008,
  346.     group_is_empty    = 0x0010,
  347.     bad_grouping      = 0x0020,
  348.     bad_exponent      = 0x0040,
  349.     overflow          = 0x0080,
  350.     bad_curr_symbol   = 0x0100,
  351.     bad_sign          = 0x0200
  352.   };
  353.  
  354.   enum {
  355.     digit_buf_size = LDBL_MAX_10_EXP+200
  356.   };
  357.  
  358.   // Fields defining digits to be converted, usually filled in by derived
  359.   // class before calling one of the conversion methods below.
  360.   int error;                    // Bit-field
  361.   int radix;                    // 8, 10, or 16, 0=not yet determined
  362.   bool is_signed;               // Sign allowed in input
  363.   bool negative;                // Minus sign was present
  364.   bool advanced;                // Iterator was advanced
  365.   bool reached_end;             // Needed a char, but iterator matched end
  366.   bool exp_negative;            // Minus sign was present on exponent
  367.   char *frac_beg;               // Start of fractional part of digits
  368.   char *exp_beg;                // Start of exponent in digits
  369.   char digits[digit_buf_size];  // Binary digits (i.e. 0,1,2 not '0','1','2')
  370.  
  371.   digit_reader_base (void): error(good), radix(0),
  372.       is_signed(true), negative(false), advanced(false), reached_end(false)
  373.   { }
  374.  
  375.   unsigned long to_ulong (char *end);
  376.   unsigned long to_ulong_dec (char *beg,char *end);
  377.  
  378. #ifdef _RWSTD_LONG_LONG
  379.   unsigned _RWSTD_LONG_LONG to_ulong_ulong (char *end);
  380. #endif
  381.  
  382.   void *to_pointer (char *end);
  383.   float to_float (char *end);
  384.   double to_double (char *end);
  385.   long double to_long_double (char *end);
  386.  
  387.  private:
  388.   void to_floating_point (char *end, char *pattern, void *result);
  389. };
  390.  
  391. // ------------------------------------------------------------
  392. // Implementation class template -- digit_reader_base_1<charT>.
  393. // ------------------------------------------------------------
  394.  
  395. // Contains parts of digit_reader that depend on charT but not on the iterator
  396. // type.
  397.  
  398. template <class charT>
  399. class _RWSTDExportTemplate digit_reader_base_1 :
  400.     public digit_reader_base,
  401.     public digit_handler_base_1<charT>
  402. {
  403.  public:
  404.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> > string_type;
  405.  
  406.  protected:
  407.   // Constructor for general numerics, gets punct from loc's numpunct<charT>.
  408.   digit_reader_base_1 (const _RW_STD::locale &loc);
  409.  
  410.   // Constructor for use by derived money_reader, caller passes punct, which
  411.   // in fact is loc's moneypunct<charT,true|false> facet.
  412.   digit_reader_base_1 (const _RW_STD::locale &loc, const punct_data<charT>&);
  413.  
  414.   // These could be moved to digit_handler_base_1<charT> ...
  415.   charT get_decimal_point() const { return this->punct.dp_; }
  416.   charT get_thousands_sep() const { return this->punct.ts_; }
  417.   const char *get_grouping() const { return this->punct.gr_.c_str(); }
  418. };
  419.  
  420. // -------------------------------------------------------------------
  421. // Implementation class template -- digit_reader<charT,InputIterator>.
  422. // -------------------------------------------------------------------
  423.  
  424. // Facets that do numeric input use temporary objects of this class to
  425. // extract keywords and strings of digits and punctuation from the input
  426. // stream.
  427.  
  428. template <class charT,class InputIterator>
  429. class _RWSTDExportTemplate digit_reader :
  430.     public digit_reader_base_1<charT>
  431. {
  432.  public:
  433.   // Constructor for reading general numerics.
  434.   digit_reader (InputIterator& in,InputIterator& end,
  435.       _RW_STD::ios_base &io);
  436.  
  437.  protected:
  438.   // Constructor for use by derived money_reader class.
  439.   digit_reader (InputIterator& in,InputIterator& end,
  440.       _RW_STD::ios_base &io,const punct_data<charT>&);
  441.  
  442.  public:
  443.   char *get_int_digits (void);      // Get integer-format digits
  444.   char *get_float_digits (void);    // Get floating point-format digits
  445.   char *get_pointer_digits (void);  // Get pointer-format digits
  446.  
  447.   // Parse keyword from input, return associated integer value
  448.   int get_keyword (const keyword_map<charT>&);
  449.  
  450.  protected:
  451.   _RW_STD::ios_base &io;
  452.   InputIterator& in;
  453.   InputIterator& end;
  454.  
  455.   const char *grouping;
  456.   charT thousands_sep;
  457.   char groups[40];
  458.   char *gpos;
  459.  
  460.   // Helper functions
  461.   char *get_digit_string (char*);       // Get a string of digits
  462.   char *get_digit_groups (char*);       // Get grouped digits (recursive)
  463.  
  464.   inline bool at_end (void) {           // Test for end of stream, and
  465. #ifdef _HPACC_
  466.     if (_RW_STD::operator == (in,end)) {
  467. #else
  468.     if (in == end) {                    //  remember whether end was
  469. #endif
  470.       this->reached_end=true;           //  ever reached
  471.       return true;
  472.     }
  473.     return false;
  474.   }
  475. };
  476. // ------------------------------------------
  477. // Implementation class -- digit_writer_base.
  478. // ------------------------------------------
  479.  
  480. // Contains the parts of digit_writer that do not depend on the template
  481. // parameters.
  482.  
  483. class _RWSTDExport digit_writer_base :
  484.     public digit_map_base
  485. {
  486.  public:
  487.   digit_writer_base (_RW_STD::ios_base &b);
  488.  
  489.   void get_pattern(char *p, char *prefix, bool is_signed);
  490.   bool get_f_pattern(char *p, char prefix);
  491.   void digitize (const void*);
  492.   void digitize (unsigned short);
  493.   void digitize (short);
  494.   void digitize (unsigned int);
  495.   void digitize (int);
  496.   void digitize (unsigned long);
  497.   void digitize (long);
  498. #ifdef _RWSTD_LONG_LONG
  499.   void digitize (unsigned _RWSTD_LONG_LONG);
  500.   void digitize (_RWSTD_LONG_LONG);
  501. #endif
  502.   void digitize (double);
  503. #ifndef _RWSTD_NO_LONG_DOUBLE
  504.   void digitize (long double);
  505. #endif
  506.  
  507.   _RW_STD::ios_base &io;
  508.   _RW_STD::ios_base::fmtflags flags;
  509.   int precision,width,radix,iprecision,num_groups;
  510.   enum { left, internal, right } adjust;
  511.   bool fractional,separable;
  512.   char *start,*end,*group;
  513.   char buffer[400];
  514.   char groups[150];
  515.  
  516.   int calc_groups (int,const char*);
  517. };
  518.  
  519. // ------------------------------------------------------------
  520. // Implementation class template -- digit_writer_base_1<charT>.
  521. // ------------------------------------------------------------
  522.  
  523. // Contains parts of digit_writer<charT,OutputWriter> that depend only on the
  524. // charT parameter.
  525.  
  526. template <class charT>
  527. class _RWSTDExportTemplate digit_writer_base_1 :
  528.     public digit_writer_base,
  529.     public digit_handler_base_1<charT>
  530. {
  531.  public:
  532.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> > string_type;
  533.  
  534.  protected:
  535.   // Constructor for general numerics, gets punct from loc's numpunct<charT>.
  536.   digit_writer_base_1
  537.       (_RW_STD::ios_base&,const _RW_STD::locale&);
  538.  
  539.   // Constructor for money, passed punct is really a moneypunct<charT,Intl>.
  540.   digit_writer_base_1  (_RW_STD::ios_base&,const punct_data<charT>&);
  541.  
  542.   // These could be moved to digit_handler_base_1<charT> ...
  543.   charT get_decimal_point() const { return this->punct.dp_; }
  544.   charT get_thousands_sep() const { return this->punct.ts_; }
  545.   const char *get_grouping() const { return this->punct.gr_.c_str(); }
  546. };
  547.  
  548. // --------------------------------------------------------------------
  549. // Implementation class template -- digit_writer<charT,OutputIterator>.
  550. // --------------------------------------------------------------------
  551.  
  552. // Facets that do numeric output use temporary objects of this type (on the
  553. // stack) to convert numeric quantities into sequences of digits and other
  554. // punctuation.
  555.  
  556. template <class charT,class OutputIterator>
  557. class _RWSTDExportTemplate digit_writer :
  558.     public digit_writer_base_1<charT>
  559. {
  560.  public:
  561.   typedef _RW_STD::basic_string<charT,_RW_STD::char_traits<charT>,_RW_STD::allocator<charT> > string_type;
  562.  
  563.   // Constructor for general numerics.
  564.   digit_writer (OutputIterator&,_RW_STD::ios_base&);
  565.  
  566.  protected:
  567.   // Constructor for use by derived money_writer classes, passed punct_data is
  568.   // really a moneypunct<charT,Intl> facet.
  569.   digit_writer (OutputIterator&,_RW_STD::ios_base&,
  570.       const punct_data<charT>&);
  571.  
  572.  public:
  573.   void put_digits (charT fill);
  574.   void put_keyword (const string_type&,charT fill);
  575.  
  576.  protected:
  577.   OutputIterator &out;
  578. };
  579. #ifndef _RWSTD_NO_NAMESPACE
  580. } // namespace __rwstd
  581. #endif
  582.  
  583. #ifdef _RWSTD_COMPILE_INSTANTIATE
  584. #include <rw/numbrw.cc>
  585. #endif
  586.  
  587. #endif
  588. #pragma option pop
  589. #endif /* __NUMBRW_H */
  590.