#ifndef FILESYSTEM_H
#define FILESYSTEM_H
#include "tier0/platform.h"
#include "tier1/utlbuffer.h"
#include "tier1/utlstring.h"
#include "engine.h"


enum EFileOptions
{
	IFILE_READ,
	IFILE_WRITE,
	IFILE_APPEND
};

typedef struct FileHandle_s
{
	FILE *file;
	FILE *parent;
	EFileOptions options;
	size_t nSize;
	size_t nOffset;
	size_t nPtr;
} *FileHandle_t;

interface IFileSystem
{
public:
	static void InitFilesystem( void );
	static void AddGameDirectory( const char *psz );
	static bool LoadPackFile( const char *szFilename );
	static void CreatePath( const char *szPath );
	static FileHandle_t Open( const char *szFilename, EFileOptions options );
	static void Close( FileHandle_t file );
	static size_t Size( FileHandle_t file );
	static size_t Read( FileHandle_t file, void *pOutput, size_t nSize);
	static size_t ReadLine( FileHandle_t file, void *pOutput, size_t nSize);
	static size_t Write( FileHandle_t file, void *pInput, size_t nSize);
	static size_t Seek( FileHandle_t file, size_t nSize);
	static size_t Tell( FileHandle_t file, size_t nSize);
	static size_t fprintf( FileHandle_t file, const char *szFormat, ...);
};

#endif
