Example #1
0
FileSource::FileSource (std::istream &i, bool pumpAndClose, BufferedTransformation *outQueue)
	: Source(outQueue), in(i)
{
	if (pumpAndClose)
	{
		PumpAll();
		Close();
	}
}
Example #2
0
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();
	}
}
Example #3
0
StringSource::StringSource(const byte *string, unsigned int length, bool pumpAll, BufferedTransformation *outQueue)
	: Source(outQueue), m_store(string, length)
{
	if (pumpAll)
		PumpAll();
}
Example #4
0
RandomNumberSource::RandomNumberSource(RandomNumberGenerator &rng, unsigned int length, bool pumpAll, BufferedTransformation *outQueue)
	: Source(outQueue), m_store(rng, length)
{
	if (pumpAll)
		PumpAll();
}
Example #5
0
StringSource::StringSource(const char *string, bool pumpAll, BufferedTransformation *outQueue)
	: Source(outQueue), m_store(string)
{
	if (pumpAll)
		PumpAll();
}