home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 11.ddi / OWLSRC.PAK / VALIDATE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  1.5 KB  |  84 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1993 by Borland International
  3. //   source\owl\validate.cpp
  4. //----------------------------------------------------------------------------
  5. #pragma hdrignore SECTION
  6. #include <owl\owlpch.h>
  7. #include <owl\validate.h>
  8. #include <owl\module.h>
  9. #include <classlib\objstrm.h>
  10. #include <stdlib.h>
  11. #include <ctype.h>
  12.  
  13. #if !defined(SECTION) || SECTION == 1
  14.  
  15. //
  16. // Construct a validator
  17. //
  18. TValidator::TValidator()
  19. {
  20.   Options = 0;
  21. }
  22.  
  23. TValidator::~TValidator()
  24. {
  25. }
  26.  
  27. //
  28. // Validator error display. Overridden in derived classes
  29. //
  30. void
  31. TValidator::Error()
  32. {
  33. }
  34.  
  35. //
  36. // Checks current input against validator. May adjust input if suppressFill
  37. // isn't set & validator has the voFill option set.
  38. //
  39. BOOL
  40. TValidator::IsValidInput(char far*, BOOL /*suppressFill*/)
  41. {
  42.   return TRUE;
  43. }
  44.  
  45. //
  46. // Checks input against validator for completeness. Never modifies input.
  47. //
  48. BOOL
  49. TValidator::IsValid(const char far*)
  50. {
  51.   return TRUE;
  52. }
  53.  
  54. UINT
  55. TValidator::Transfer(char far*, void*, TTransferDirection)
  56. {
  57.   return 0;
  58. }
  59.  
  60. TValidator::TXValidator::TXValidator(UINT resId) : TXOwl(resId)
  61. {
  62. }
  63.  
  64. #endif
  65. #if !defined(SECTION) || SECTION == 2
  66.  
  67. IMPLEMENT_STREAMABLE(TValidator);
  68.  
  69. void*
  70. TValidator::Streamer::Read(ipstream& is, uint32 /*version*/) const
  71. {
  72.   is >> GetObject()->Options;
  73.   return GetObject();
  74. }
  75.  
  76. void
  77. TValidator::Streamer::Write(opstream& os) const
  78. {
  79.   os << GetObject()->Options;
  80. }
  81.  
  82. #endif
  83.  
  84.