| 26 | } |
| 27 | |
| 28 | void TabFile::Open(void) { |
| 29 | if (_tabFile == "stdin" || _tabFile == "-") { |
| 30 | _tabStream = &cin; |
| 31 | } |
| 32 | else { |
| 33 | _tabStream = new ifstream(_tabFile.c_str(), ios::in); |
| 34 | |
| 35 | if( isGzipFile(_tabStream) ) { |
| 36 | delete _tabStream; |
| 37 | _tabStream = new igzstream(_tabFile.c_str(), ios::in); |
| 38 | } |
| 39 | if ( _tabStream->fail() ) { |
| 40 | cerr << "Error: The requested file (" |
| 41 | << _tabFile |
| 42 | << ") " |
| 43 | << "could not be opened. " |
| 44 | << "Error message: (" |
| 45 | << strerror(errno) |
| 46 | << "). Exiting!" << endl; |
| 47 | exit (1); |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | |
| 53 | // Close the TAB file |
no test coverage detected