// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

// PURPOSE: Provides an interface for reading from a file.

#ifndef BD_IF_STREAM_H
#define BD_IF_STREAM_H

#include <bdCore/bdMemory/bdMemory.h>
#include <bdCore/bdStreams/bdIStream.h>
#include <bdCore/bdStreams/bdDefaultFileStreambuf.h>

/// Provides a stream interface for reading data from files.
class bdIfStream : public bdIStream
{
	public:

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

		/// Constructor. 
		/// Attempts to open a file for reading using a bdDefaultFileStreambuf. 
		/// The bdDefaultFileStreambuf will be constructed automatically in 
		/// bdDefaultFileStreambuf::READ mode.
		/// \param filename[in]	The filename of the file that should be opened.
		bdIfStream(const bdNChar8 *const filename);

	protected:

		/// The file stream buffer manipulated by this file stream.
		bdDefaultFileStreambuf m_fileStreambuf;
};

#endif // BD_IF_STREAM_H

