home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 26
/
CD_ASCQ_26_1295.iso
/
vrac
/
tvme30.zip
/
TINTFILE.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-02
|
4KB
|
142 lines
// File : TINTFILE.H
// Author : Eric Woodruff, CIS ID: 72134,1150
// Updated : Wed 08/02/95 17:54:19
// Note : Copyright 1994-95, Eric Woodruff, All rights reserved
// Compiler: Borland C++ 3.1 to 4.xx
//
// TInteger, TLong, and TFilename class header file. Nothing special, just
// enough to provide some form of validated input for the demo.
//
#if !defined(__FLAT__)
#if !defined(_NEAR)
#define _NEAR near
#endif
#if !defined(_FAR)
#define _FAR far
#endif
#endif
#if defined(Uses_TInteger)
class TInteger : public TInputLine
{
private:
short max_val, min_val; // Maximum and minimum values.
public:
TInteger(const TRect &bounds, int aMaxLen, short maxVal = 32767,
short minVal = 0);
virtual ushort dataSize();
virtual void getData(void *rec);
virtual void setData(void *rec);
virtual Boolean valid(ushort command);
virtual void handleEvent(TEvent& event);
private:
virtual const char *streamableName() const
{ return name; }
protected:
TInteger( StreamableInit );
virtual void write( opstream& );
virtual void *read( ipstream& );
public:
static const char * const _NEAR name;
static TStreamable *build();
};
inline ipstream& operator >> ( ipstream& is, TInteger& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TInteger*& cl )
{ return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, TInteger& cl )
{ return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, TInteger* cl )
{ return os << (TStreamable *)cl; }
#endif // class TInteger
#if defined(Uses_TLong)
class TLong : public TInputLine
{
private:
long max_val, min_val; // Maximum and minimum values.
public:
TLong(const TRect &bounds, int aMaxLen, long maxVal = 0x7FFFFFFFL,
long minVal = 0L);
virtual ushort dataSize();
virtual void getData(void *rec);
virtual void setData(void *rec);
virtual Boolean valid(ushort command);
virtual void handleEvent(TEvent& event);
private:
virtual const char *streamableName() const
{ return name; }
protected:
TLong( StreamableInit );
virtual void write( opstream& );
virtual void *read( ipstream& );
public:
static const char * const _NEAR name;
static TStreamable *build();
};
inline ipstream& operator >> ( ipstream& is, TLong& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TLong*& cl )
{ return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, TLong& cl )
{ return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, TLong* cl )
{ return os << (TStreamable *)cl; }
#endif // class TLong
#if defined(Uses_TFilename)
class TFilename : public TInputLine
{
public:
TFilename(const TRect&bounds, int aMaxLen) :
TInputLine(bounds, aMaxLen) {}
virtual void handleEvent(TEvent& event);
private:
virtual const char *streamableName() const
{ return name; }
protected:
TFilename( StreamableInit );
public:
static const char * const _NEAR name;
static TStreamable *build();
};
inline ipstream& operator >> ( ipstream& is, TFilename& cl )
{ return is >> (TStreamable&)cl; }
inline ipstream& operator >> ( ipstream& is, TFilename*& cl )
{ return is >> (void *&)cl; }
inline opstream& operator << ( opstream& os, TFilename& cl )
{ return os << (TStreamable&)cl; }
inline opstream& operator << ( opstream& os, TFilename* cl )
{ return os << (TStreamable *)cl; }
#endif // class TFilename