//************************************************************************** /// \file /// header file for a library of auxiliary IO functions -- myio.h /// \author Rex Forsyth //************************************************************************** #ifndef MYIO_H #define MYIO_H #include using namespace std; void clrStream(); ///< \brief Remove all data from the cin stream /// up to and including the next new line /// character char getResponse(char defalt); ///< Get a character from the cin stream. // If the character is a new line, return the // defalt otherwise return the character // entered. The cin stream is cleared void getValid(int&); ///< obtain a valid integer from the user void getValid(double&); ///< obtain a valid real number from the user void openIn(ifstream& iStr, string& filename); ///< Attach a file to a stream. // If unable to attach the given file, it // will continue asking for a file until // a valid file is found and attached to iStr. // filename will contain the name of the // file attached. void openOut(ofstream& oStr, string& filename); ///< Attach a file to a stream. // If unable to attach the given file, it // will continue asking for a file until // a valid file is found and attached to oStr. // filename will contain the name of the // file attached. #endif