home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / SCL.EXE / BINARY.H < prev    next >
C/C++ Source or Header  |  1994-08-06  |  2KB  |  72 lines

  1. #ifndef BINARY_H
  2. #define    BINARY_H 1
  3.  
  4. /*
  5. * NIST STEP Core Class Library
  6. * clstepcore/SdaiBinary.h
  7. * February, 1994
  8. * KC Morris
  9.  
  10. * Development of this software was funded by the United States Government,
  11. * and is not subject to copyright.
  12. */
  13.  
  14. /* $Id: SdaiBinary.h,v */
  15.  
  16.  
  17.  
  18. #include <ctype.h>
  19. #include <stdio.h>
  20. #include <string.h>
  21. #include <strstream.h>
  22.  
  23. class ErrorDescriptor;
  24. #include <scl_string.h>
  25. #include <errordesc.h>
  26.  
  27. #ifndef BINARY_DELIM
  28. #define BINARY_DELIM '\"'
  29. #endif
  30.  
  31. class SdaiBinary : public SCLstring
  32. {
  33.   public:
  34.  
  35.     //constructor(s) & destructor    
  36.     SdaiBinary (const char * str = 0, int max =0) : SCLstring (str,max) { }
  37.     SdaiBinary (SCLstring& s)   : SCLstring (s) { }
  38.     SdaiBinary (SdaiBinary& s)  : SCLstring (s) { }
  39.     ~SdaiBinary ()  {  }
  40.  
  41.     //  operators
  42.     SdaiBinary& operator= (const char* s);
  43.  
  44.     // format for STEP
  45.     const char * asStr () const  {  return chars ();  }
  46.     void STEPwrite (ostream& out =cout)  const;
  47.     const char * STEPwrite (SCLstring &s) const;
  48.  
  49.     Severity StrToVal (const char *s, ErrorDescriptor *err);
  50.     Severity STEPread (istream& in, ErrorDescriptor *err);
  51.     Severity STEPread (const char *s, ErrorDescriptor *err);
  52.  
  53.     Severity BinaryValidLevel (const char *value, ErrorDescriptor *err,
  54.                    int optional, char *tokenList,
  55.                    int needDelims = 0, int clearError = 1);
  56.     Severity BinaryValidLevel (istream &in, ErrorDescriptor *err, 
  57.                    int optional, char *tokenList,
  58.                    int needDelims = 0, int clearError = 1);
  59.  
  60.  protected:
  61.   Severity ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal = 1,
  62.               int needDelims = 1);
  63. };
  64.  
  65. inline
  66. SdaiBinary& 
  67. SdaiBinary::operator= (const char* s)
  68.     { SCLstring::operator= (s);
  69.       return *this;  }
  70.  
  71. #endif
  72.