4 * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
7 * 10-02-07,Nigel Brown(EMBL): Removed delimiter and findDelimiter()
8 * members, as functionality now handled by the stream class.
14 #include "FileParser.h"
15 const char LF = 0x0a; //linefeed
16 const char CR = 0x0d; //carriage return
24 FileParser::FileParser()
29 FileParser::~FileParser()
31 // Dont do anything!!!!
35 void FileParser::fillCharTab(void)
40 for (i = 0; i < 128; chartab[i++] = 0)
42 for (i = 0; i <= userParameters->getMaxAA() + 1; i++)
44 c = userParameters->getAminoAcidCode(i);
45 chartab[(int)c] = chartab[tolower(c)] = c;
49 void FileParser::freeFileResources(InFileStream* filePtr)
60 char FileParser::getDelimiter(string filename)
66 in.open(filename.c_str(), ios::in);
67 in.seekg(0, ios::beg);
69 //look for CR or LF or CRLF (or LFCR)
85 //cout << "file is Mac System 9" << endl;
89 //cout << "file is UNIX" << endl;
93 //cout << "file is DOS" << endl;
96 default: //short or empty file
97 //cout << "file is UNIX (default)" << endl;