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

  1. #ifndef __VENDOR_H
  2. #define __VENDOR_H
  3. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  4. /***************************************************************************
  5.  *
  6.  * vendor -- Vendor-supplied declarations for the Standard Library locale
  7.  *           classes.
  8.  *
  9.  * $Id: vendor,v 1.10 1996/10/02 01:48:00 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  14.  *
  15.  * This computer software is owned by Rogue Wave Software, Inc. and is
  16.  * protected by U.S. copyright laws and other laws and by international
  17.  * treaties.  This computer software is furnished by Rogue Wave Software,
  18.  * Inc. pursuant to a written license agreement and may be used, copied,
  19.  * transmitted, and stored only in accordance with the terms of such
  20.  * license and with the inclusion of the above copyright notice.  This
  21.  * computer software or any other copies thereof may not be provided or
  22.  * otherwise made available to any other person.
  23.  *
  24.  * U.S. Government Restricted Rights.  This computer software is provided
  25.  * with Restricted Rights.  Use, duplication, or disclosure by the
  26.  * Government is subject to restrictions as set forth in subparagraph (c)
  27.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  28.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  29.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  30.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  31.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  32.  *
  33.  ***************************************************************************
  34.  *
  35.  *
  36.  **************************************************************************/
  37.  
  38. #ifndef __STD_LOC_VENDOR
  39. #define __STD_LOC_VENDOR
  40.  
  41. #include <rw/ctype>
  42. #include <rw/numeral>
  43.  
  44. #ifndef _RWSTD_NO_NAMESPACE
  45. namespace __rwstd {
  46. #endif
  47.  
  48. // --------------------------------------------------------
  49. // Implementation function template -- create_native_facet.
  50. // --------------------------------------------------------
  51.  
  52. // Vendors must specialize this inline function template for each facet of the
  53. // vendor-default native ("") locale that is different from the same facet of
  54. // the classic locale.  Each specialization should construct and return a new
  55. // instance of the requested native-behavior facet with an initial reference
  56. // count of 1 (not the default 0!).
  57.  
  58. // Note that a specialization for ctype<char> must always be provided, because
  59. // ctype<char> lacks a constructor with the signature used in the template.
  60.  
  61. inline _RW_STD::ctype<char>* create_native_facet (_RW_STD::ctype<char>*) {
  62.   return new _RW_STD::ctype<char>(NULL,false,1);
  63. }
  64.  
  65. inline _RW_STD::numpunct<char>* create_native_facet (_RW_STD::numpunct<char>*) {
  66.   return new _RW_STD::numpunct_byname<char>("",1);
  67. }
  68.  
  69. // The default template function for Facets not specialized above returns a
  70. // facet with classic-locale behavior.
  71.  
  72. template <class Facet>
  73. inline Facet* create_native_facet (Facet*) {
  74.   return create_named_facet((Facet*)0,"",(size_t)1);
  75. }
  76.  
  77. #ifndef _RWSTD_NO_NAMESPACE
  78. } // namespace __rwstd
  79. #endif
  80.  
  81. #endif // __STD_LOC_VENDOR
  82.  
  83. #pragma option pop
  84. #endif /* __VENDOR_H */
  85.