4 * Copyright (c) 2007 Des Higgins, Julie Thompson and Toby Gibson.
6 /** The aim of this class is to return one sequence at a time.
7 * Note that the file must be open when it is passed to the FileParser.
8 * The parser does not know the name of the file to open. Only the filereader knows.
12 * Mark 24-1-2007. I added the function findDelimiter to determine if '\r' or '\n'
13 * will be used as the line delimiter when parsing the file.
15 * 10-02-07,Nigel Brown(EMBL): Removed delimiter and findDelimiter()
16 * members, as functionality now handled by the stream class.
22 #include "../alignment/Sequence.h"
23 #include "../general/userparams.h"
25 #include "InFileStream.h"
35 virtual ~FileParser();
36 virtual vector<Sequence> getSeqRange(int firstSeq, int num, string *offendingSeq) = 0;
37 virtual Sequence getSeq(int seqNum, string *offendingSeq=NULL) = 0;
38 virtual int countSeqs() = 0; // VIRTUAL
39 virtual void getSecStructure(vector<char>& gapPenaltyMask,
40 vector<char>& secStructMask,
41 string& secStructName, int &structPenalties, int length) = 0;
42 void fillCharTab(void);
43 char getDelimiter(string filename);
46 int getParseExitCode() { return parseExitCode; };
49 void freeFileResources(InFileStream* filePtr);
50 InFileStream* _fileIn;
51 int parseExitCode; // reason for returning empty sequence
52 // vector; same as used in FileReader