123
This commit is contained in:
68
ResourceCompilerPC/StatCGFCompiler/File.h
Normal file
68
ResourceCompilerPC/StatCGFCompiler/File.h
Normal file
@@ -0,0 +1,68 @@
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Crytek Engine Source File.
|
||||
// Copyright (C), Crytek Studios, 2002.
|
||||
// -------------------------------------------------------------------------
|
||||
// File name: file.h
|
||||
// Version: v1.00
|
||||
// Created: 28/5/2001 by Vladimir Kajalin
|
||||
// Compilers: Visual Studio.NET
|
||||
// Description: cecahed file access
|
||||
// -------------------------------------------------------------------------
|
||||
// History:
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PS2
|
||||
#ifndef FILE_H
|
||||
#define FILE_H
|
||||
|
||||
#define MAX_PATH_LENGTH 512
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
class CXFile
|
||||
{
|
||||
public:
|
||||
|
||||
CXFile();
|
||||
~CXFile() { FClose(); }
|
||||
|
||||
int FRead(void *pDest,int nSize,int nNumElems);
|
||||
static void SafeRead(FILE *f, void *buffer, int count);
|
||||
int FSeek(int nOff,int nFrom);
|
||||
int FLoad(const char *filename);
|
||||
void FClose();
|
||||
|
||||
static bool FileExist(const char *filename);
|
||||
static bool IsFileExist(const char *filename);
|
||||
//-1 if file does not exist
|
||||
static int GetLength(const char *filename);
|
||||
static int GetLength(FILE *f);
|
||||
static int LoadInMemory(const char *filename, void **bufferptr);
|
||||
|
||||
static bool IsOutOfDate(const char *pFileName1,const char *pMasterFile);
|
||||
static int GetWriteTime(const char *pFileName1);
|
||||
|
||||
//utils
|
||||
static void RemoveExtension (char *path);
|
||||
static void ReplaceExtension(char *path, const char *new_ext);
|
||||
static char *GetExtension (const char *filename);
|
||||
static char *GetString (FILE *fp,const char *key);
|
||||
static void GetPath(char *path);
|
||||
|
||||
//Tim code
|
||||
static void SetLanguage (const char *command=NULL);
|
||||
static char *ConvertFilename(const char *filename);
|
||||
|
||||
private:
|
||||
|
||||
char *m_szFileStart,*m_pCurrPos,*m_pEndOfFile;
|
||||
int m_nFileSize;
|
||||
char m_sLoadedFileName[512];
|
||||
};
|
||||
|
||||
#endif
|
||||
#else //PS2
|
||||
#include "..\CryCommon\File.h"
|
||||
#endif
|
||||
Reference in New Issue
Block a user