1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-23 22:23:52 +00:00
openmw-tes3mp/stream/servers/file_stream.h
2010-01-01 16:39:11 +01:00

28 lines
524 B
C++

#ifndef MANGLE_STREAM_FILESERVER_H
#define MANGLE_STREAM_FILESERVER_H
#include "std_stream.h"
#include <fstream>
namespace Mangle {
namespace Stream {
/** Very simple file input stream, based on std::ifstream
*/
class FileStream : public StdStream
{
std::ifstream file;
public:
FileStream(const std::string &name)
: StdStream(&file)
{
file.open(name.c_str(), std::ios::binary);
}
~FileStream() { file.close(); }
};
typedef boost::shared_ptr<FileStream> FileStreamPtr;
}} // namespaces
#endif