// NOFILE.H - NoFileError exception class #ifndef NOFILE_H #define NOFILE_H class NoFileError { public: NoFileError( const string & fn ) { filename = fn; } friend ostream & operator <<( ostream & os, const NoFileError & nf ); private: string filename; }; ostream & operator <<( ostream & os, const NoFileError & nf ) { cout << "Exception thrown (file not found): " << nf.filename << endl; return os; }; #endif