home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 May
/
Pcwk5b98.iso
/
Borland
/
Cplus45
/
BC45
/
CLOBSS.PAK
/
LDATE.CPO
< prev
next >
Wrap
Text File
|
1995-08-29
|
2KB
|
71 lines
/*------------------------------------------------------------------------*/
/* */
/* LDATE.CPP */
/* */
/* Copyright Borland International 1991, 1993 */
/* All Rights Reserved */
/* */
/*------------------------------------------------------------------------*/
#if !defined( __STRSTREA_H )
#include <strstrea.h>
#endif // __STRSTREA_H
#if !defined( __STDIO_H )
#include <stdio.h>
#endif // __STDIO_H
#if !defined( __LDATE_H )
#include "classlib\obsolete\ldate.h"
#endif // __LDATE_H
const BufSize = 20;
static char *MonthNames[] =
{
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
int BaseDate::isEqual( const Object& testDate ) const
{
return MM == ((BaseDate&)testDate).MM &&
DD == ((BaseDate&)testDate).DD &&
YY == ((BaseDate&)testDate).YY;
}
int BaseDate::isLessThan( const Object& testDate ) const
{
if( YY != ((BaseDate&)testDate).YY )
return YY < ((BaseDate&)testDate).YY;
if( MM != ((BaseDate&)testDate).MM )
return MM < ((BaseDate&)testDate).MM;
return DD < ((BaseDate&)testDate).DD;
}
hashValueType BaseDate::hashValue() const
{
return hashValueType( YY + MM + DD );
}
void Date::printOn( ostream& outputStream ) const
{
char temp[BufSize];
ostrstream os( temp, BufSize );
os << MonthNames[ Month() ] << " "
<< Day() << ", " << Year() << ends;
outputStream << temp;
}