You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. Modified to compile with gcc v3.x by Salvador E. Tropea, with the help of
  9. Andris Pavenis.
  10. *
  11. *
  12. */
  13. /* ------------------------------------------------------------------------*/
  14. /* */
  15. /* class pstream */
  16. /* */
  17. /* Base class for handling streamable objects. */
  18. /* */
  19. /* ------------------------------------------------------------------------*/
  20. #if defined( Uses_pstream ) && !defined( __pstream )
  21. #define __pstream
  22. class TStreamableTypes;
  23. class pstream
  24. {
  25. friend class TStreamableTypes;
  26. public:
  27. enum StreamableError { peNotRegistered, peInvalidType };
  28. enum PointerTypes { ptNull, ptIndexed, ptObject };
  29. pstream(CLY_streambuf *);
  30. virtual ~pstream();
  31. int rdstate() const;
  32. int eof() const;
  33. int fail() const;
  34. int bad() const;
  35. int good() const;
  36. void clear( int = 0 );
  37. operator void *() const;
  38. int operator ! () const;
  39. CLY_streambuf *rdbuf() const;
  40. static void initTypes();
  41. // SET: called atexit to kill the collection
  42. static void deInitTypes();
  43. void error( StreamableError );
  44. void error( StreamableError, const TStreamable& );
  45. static void registerType( TStreamableClass *ts );
  46. protected:
  47. pstream();
  48. CLY_streambuf *bp;
  49. int state;
  50. void init(CLY_streambuf *);
  51. void setstate( int );
  52. static TStreamableTypes * types;
  53. };
  54. #endif // Uses_pstream