#pragma warning (disable : 4786)
#include "stdafx.h"
#include "fileio.hpp"

bool FileExists (const char *file)
{
	DWORD toret;

	toret = GetFileAttributes (file);
	if (toret == -1)
	{
		return false;
	}
	return true;
}

HANDLE OpenFile (const char *file)
{
	HANDLE toret;

	toret = CreateFile (file,GENERIC_ALL,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN,NULL);
	return toret;
}
HANDLE NewFile (const char *file)
{
	HANDLE toret;

	toret = CreateFile (file,GENERIC_ALL,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN,NULL);
	return toret;
}

bool DumpData (HANDLE file,const std::vector<CDataEntry>& data)
{
	std::vector<CDataEntry>::const_iterator iter;

	for (iter = data.begin ();iter != data.end ();iter++)
	{
		iter->DumpData (file);
	}
	return false;
}
bool CloseFile (HANDLE file)
{
	CloseHandle (file);
	return false;
}

