FileSource::FileSource (std::istream &i, bool pumpAndClose, BufferedTransformation *outQueue) : Source(outQueue), in(i) { if (pumpAndClose) { PumpAll(); Close(); } }
FileSource::FileSource (const char *filename, bool pumpAndClose, BufferedTransformation *outQueue) : Source(outQueue), file(filename, std::ios::in | std::ios::binary), in(file) { if (!file) { std::string message = "FileSource: error opening file for reading: "; message += filename; throw OpenErr(message.c_str()); } if (pumpAndClose) { PumpAll(); Close(); } }
StringSource::StringSource(const byte *string, unsigned int length, bool pumpAll, BufferedTransformation *outQueue) : Source(outQueue), m_store(string, length) { if (pumpAll) PumpAll(); }
RandomNumberSource::RandomNumberSource(RandomNumberGenerator &rng, unsigned int length, bool pumpAll, BufferedTransformation *outQueue) : Source(outQueue), m_store(rng, length) { if (pumpAll) PumpAll(); }
StringSource::StringSource(const char *string, bool pumpAll, BufferedTransformation *outQueue) : Source(outQueue), m_store(string) { if (pumpAll) PumpAll(); }