File indexing completed on 2024-09-07 04:34:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef FILEIN_H
0011 #define FILEIN_H
0012
0013 #include <fstream>
0014 #include <iostream>
0015
0016 #include <vector>
0017
0018 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
0019
0020 class ALIFileIn {
0021 public:
0022 ALIFileIn() {}
0023 ~ALIFileIn() {}
0024
0025 private:
0026 ALIFileIn(const ALIstring& name) : theName(name) {}
0027
0028 public:
0029
0030 static ALIFileIn& getInstance(const ALIstring& name);
0031
0032 static ALIFileIn& getInstanceOpened(const ALIstring& name);
0033
0034
0035 ALIint getWordsInLine(std::vector<ALIstring>& wl);
0036
0037
0038 void ErrorInLine();
0039
0040
0041 const ALIint nline() { return theLineNo[theCurrentFile]; }
0042
0043 const ALIstring& name() { return theName; }
0044
0045 ALIbool eof();
0046 void close();
0047
0048 private:
0049 void openNewFile(const char* filename);
0050
0051 private:
0052 std::vector<std::ifstream*> theFiles;
0053
0054 std::vector<ALIint> theLineNo;
0055 std::vector<ALIstring> theNames;
0056 int theCurrentFile;
0057
0058
0059
0060 static std::vector<ALIFileIn*> theInstances;
0061
0062
0063 ALIstring theName;
0064 };
0065
0066 #endif