home *** CD-ROM | disk | FTP | other *** search
- //
- // $Id: DataInputStream.h,v 1.1.1.1 2000/06/02 22:23:02 sergey Exp $
- //
-
- #ifndef _DataInputStream_h_
- #define _DataInputStream_h_
-
- #include "InputStream.h"
-
-
- namespace Util
- {
- //
- // Abstract base stream class, oriented to read concrete data types.
- //
- class DataInputStream: public InputStream
- {
- public:
- int readAsString(char* string, int length) const { return readData(string, length); }
-
- template <typename T>
- T readAs() const;
- };
-
- template <typename T>
- T DataInputStream::readAs() const
- {
- T value = T();
- readData(&value, sizeof(T));
- return value;
- }
- }
- // namespace Util
-
- #endif // _DataInputStream_h_
-