home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
dbutil.zip
/
BUFOP.ZIP
/
PCTYPES.HPP
< prev
Wrap
Text File
|
1993-08-30
|
2KB
|
61 lines
#ifndef _PCTYPES_
#define _PCTYPES_
#include "Istring.hpp"
// PCTypes.hpp precompiler types
// I'm more than unsure about this BUT...
// I think each type that will be put into the collection classes
// (that will use key access) must have a separate header file
// One of these days I will understand the syntax of C++;
//
// I'm not sure when to just make a header file an when to
// make a cpp file also. Seems most of the books I read says this
// (putting code into a h file) should not be done
// yet when I look at the example programs from IBM, they
// all seem to to it for "small" h files.
// Took this style from an IBM example
// but seems strange to me.
class Vtype // types of variables that are acceptable
{
public:
// constructors
Vtype( IString & name, short type, short dlength=1, Boolean Obj=false);
Vtype();
~Vtype();
void setParams(char * name, short type, short len, Boolean Obj=false);
Vtype & operator=(Vtype const & v);
Boolean operator==( Vtype const& v) const;
Boolean operator<(Vtype const& v);
Boolean operator>(Vtype const& v);
Boolean operator!=(Vtype const& v);
Boolean operator <=(Vtype const & v);
Boolean operator >=(Vtype const & v);
void setName(IString & name);
void setType(short type);
void setObj(Boolean O=true);
IString const& getName() const;
short getType() const;
short getLen() const;
Boolean isObj()const;
private:
IString typeName; // type name such as int, short, date
short sqlType; // the corresponding SQL type
Boolean anObj; // if type is an object (only IDate, IString)
short defaultLength;
};
inline IString const & key (Vtype const & V) {
return V.getName();
}
#endif