1 #include "TextCollection.h"
3 #include "SWCSAWrapper.h"
4 #include "RLCSAWrapper.h"
10 * Init text collection from a file
12 * See TCImplementation.h for more details.
14 TextCollection * TextCollection::Load(FILE *fp, char const *filename, index_mode_t im, unsigned samplerate)
17 if (std::fread(&type, 1, 1, fp) != 1)
18 throw std::runtime_error("TextCollection::Load(): file read error (type flag).");
22 return new FMIndex(fp, im, samplerate);
25 return new SWCSAWrapper(fp, filename);
28 return new RLCSAWrapper(fp, filename);
32 std::cerr << "TextCollection::Load(): invalid save file version or corrupted input file." << std::endl;