#ifndef STLSCRIBE_H
#define STLSCRIBE_H

#include "IScribe.h"

namespace Salamander
{

/*
** Scribes are used to read and write data. They are created using fileio() and each instance of the class
** represents a file.
*/
class STLScribe : public IScribe
{

public:
	/*
	** Open or create the specified file.
	*/
	STLScribe(const std::string& filename, accessMode mode);

	/*
	** Destructor.
	*/
	virtual ~STLScribe();

public:
	/*
	** Read a value from file. Most common types are supported, and a full list is defined below.
	*/
	template<typename T>
		T read();

	/*
	** Write a value to file. 
	*/
	template<typename T>
		void write(const T& value);

private:
	/*
	** We wrap fstream for file reading and writing on standard platforms.
	*/
	std::fstream fstream_;
};

}

#include "STLScribe.inl"

#endif //STLSCRIBE_H