// MYIO.CPP #ifndef __MYIO_CPP #define __MYIO_CPP #include #include #include ////////////////////////////////////////////////////////////////////////// #ifdef __PC__ #include #include #include inline MyIO::MyIO() { ; } inline MyIO::~MyIO() { ; } inline void MyIO::MemChk() { cout << " Stack: " << stackavail() << " Stack Pointer: " << _SP; cout << " Core Left: " << coreleft() << "\n"; } inline void MyIO::ClearScr() { clrscr(); cout << "\n"; } char MyIO::GetChar() { while( ! KeyPressed() ) Date(); return( toupper( getche() ) ); } inline void MyIO::GotoXY( int x1, int y1 ) { gotoxy( x1, y1 ); } int MyIO::KeyPressed() { return( kbhit() ); } void MyIO::Pause() { fflush( stdin ); cout << "Press Any Key to Continue. "; while( ! KeyPressed() ) Date(); GetChar(); cout << "\r \r"; } void MyIO::Date() { int x2; int y2; time_t timer; struct tm *tblock; x2 = wherex(); y2 = wherey(); _setcursortype(_NOCURSOR); GotoXY( 1, 1 ); cout << "\t\t\t\t\t\t "; GotoXY( 55, 1 ); timer = time( NULL ); tblock = localtime( &timer ); cout << asctime( tblock ); GotoXY( x2, y2 ); _setcursortype(_NORMALCURSOR); } #endif // __PC__ ////////////////////////////////////////////////////////////////////////// #ifdef __HP__ #include #include #include WINDOW *win; MyIO::MyIO() { // initscr(); // win = newwin( 50, 40, 0, 0 ); } inline MyIO::~MyIO() { // endwin(); } inline void MyIO::MemChk() { // cout << " Stack: " << stackavail(); << " Stack Pointer: " << _SP << "\n"; cout << " Not Available On this System ! \n"; } inline void MyIO::ClearScr() { // clear(); // refresh(); system( "clear" ); } inline char MyIO::GetChar() { // return( toupper( getch() ) ); char c; cin >> c; return( c ); } inline void MyIO::GotoXY( int x1, int y1 ) { // move( x1, y1 ); // refresh(); } inline int MyIO::KeyPressed() { return( 1 ); } void MyIO::Pause() { cout << "Press to Continue. "; GetChar(); cout << "\r\b\r \r"; } void MyIO::Date() { int x2; int y2; time_t timer; struct tm *tblock; x2 = 1; y2 = 1; GotoXY( 55, 1 ); timer = time( NULL ); tblock = localtime( &timer ); cout << asctime( tblock ); GotoXY( x2, y2 ); } #endif // __HP__ ////////////////////////////////////////////////////////////////////////// #endif // __MYIO_CPP