home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / base / basicops.cxx < prev    next >
C/C++ Source or Header  |  1994-10-14  |  2KB  |  88 lines

  1.  
  2.  
  3.  
  4.  
  5. /*
  6.  *
  7.  *          Copyright (C) 1994, M. A. Sridhar
  8.  *  
  9.  *
  10.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  11.  *     to copy, modify or distribute this software  as you see fit,
  12.  *     and to use  it  for  any  purpose, provided   this copyright
  13.  *     notice and the following   disclaimer are included  with all
  14.  *     copies.
  15.  *
  16.  *                        DISCLAIMER
  17.  *
  18.  *     The author makes no warranties, either expressed or implied,
  19.  *     with respect  to  this  software, its  quality, performance,
  20.  *     merchantability, or fitness for any particular purpose. This
  21.  *     software is distributed  AS IS.  The  user of this  software
  22.  *     assumes all risks  as to its quality  and performance. In no
  23.  *     event shall the author be liable for any direct, indirect or
  24.  *     consequential damages, even if the  author has been  advised
  25.  *     as to the possibility of such damages.
  26.  *
  27.  */
  28.  
  29.  
  30.  
  31.  
  32. #if defined(__GNUC__)
  33. #pragma implementation
  34. #endif
  35.  
  36. #include "base/basicops.h"
  37. #include "base/iofilter.h"
  38. #include "base/stream.h"
  39.  
  40.  
  41.  
  42. bool CL_RestoreFrom (long& b, const CL_Stream& s, CL_ObjectIOFilter* )
  43. {
  44.     return s.Read (b);
  45. }
  46.  
  47.  
  48. bool CL_RestoreFrom (CL_ObjectPtr& b, const CL_Stream& s, CL_ObjectIOFilter* f)
  49. {
  50.     if (f) {
  51.         b = f->RestoreFrom (s);
  52.         return b != NULL;
  53.     }
  54.     return s.Read (b);
  55. }
  56.  
  57.  
  58.  
  59.  
  60. bool CL_RestoreFrom (CL_Object& b, const CL_Stream& s, CL_ObjectIOFilter* f)
  61. {
  62.     return f ? f->RestoreFrom (s, b) : s.Read (b);
  63. }
  64.  
  65.  
  66.  
  67. bool CL_SaveTo (const CL_Object& b, CL_Stream& s, CL_ObjectIOFilter* f)
  68. {
  69.     return f ? f->SaveTo (s, b) : s.Write (b);
  70. }
  71.  
  72.  
  73.  
  74. bool CL_SaveTo (const long& b, CL_Stream& s, CL_ObjectIOFilter*)
  75. {
  76.     return  s.Write (b);
  77. }
  78.  
  79.  
  80. bool CL_SaveTo (const CL_ObjectPtr& b, CL_Stream& s,
  81.                 CL_ObjectIOFilter* f)
  82. {
  83.     return f ? f->SaveTo (s, b) : s.Write (b);
  84. }
  85.  
  86.  
  87.  
  88.