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 / SDAIBINA.H < prev    next >
Text File  |  1994-08-06  |  2KB  |  74 lines

  1. #ifndef SDAIBINARY_H
  2. #define    SDAIBINARY_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. #ifdef __O3DB__
  17. #include <OpenOODB.h>
  18. #endif
  19.  
  20. #include <ctype.h>
  21. #include <stdio.h>
  22. #include <string.h>
  23. #include <strstream.h>
  24.  
  25. class ErrorDescriptor;
  26. #include <scl_string.h>
  27. #include <errordesc.h>
  28.  
  29. #ifndef BINARY_DELIM
  30. #define BINARY_DELIM '\"'
  31. #endif
  32.  
  33. class SdaiBinary : public SCLstring
  34. {
  35.   public:
  36.  
  37.     //constructor(s) & destructor    
  38.     SdaiBinary (const char * str = 0, int max =0) : SCLstring (str,max) { }
  39.     SdaiBinary (SCLstring& s)   : SCLstring (s) { }
  40.     SdaiBinary (SdaiBinary& s)  : SCLstring (s) { }
  41.     ~SdaiBinary ()  {  }
  42.  
  43.     //  operators
  44.     SdaiBinary& operator= (const char* s);
  45.  
  46.     // format for STEP
  47.     const char * asStr () const  {  return chars ();  }
  48.     void STEPwrite (ostream& out =cout)  const;
  49.     const char * STEPwrite (SCLstring &s) const;
  50.  
  51.     Severity StrToVal (const char *s, ErrorDescriptor *err);
  52.     Severity STEPread (istream& in, ErrorDescriptor *err);
  53.     Severity STEPread (const char *s, ErrorDescriptor *err);
  54.  
  55.     Severity BinaryValidLevel (const char *value, ErrorDescriptor *err,
  56.                    int optional, char *tokenList,
  57.                    int needDelims = 0, int clearError = 1);
  58.     Severity BinaryValidLevel (istream &in, ErrorDescriptor *err, 
  59.                    int optional, char *tokenList,
  60.                    int needDelims = 0, int clearError = 1);
  61.  
  62.  protected:
  63.   Severity ReadBinary(istream& in, ErrorDescriptor *err, int AssignVal = 1,
  64.               int needDelims = 1);
  65. };
  66.  
  67. inline
  68. SdaiBinary& 
  69. SdaiBinary::operator= (const char* s)
  70.     { SCLstring::operator= (s);
  71.       return *this;  }
  72.  
  73. #endif
  74.