True Axis Physics SDK 1.2.0.1 Beta Documentation
www.trueaxis.com

FileSystem.h

00001 //---------------------------------------------------------------------------------
00002 // File Name: FileSystem.h
00003 // Description:
00004 //
00005 // Copyright (C) 2004 - 2005 True Axis Pty Ltd, Australia. 
00006 // All Rights Reserved.
00007 //
00008 // History:
00009 //      Created File.
00010 //---------------------------------------------------------------------------------
00011 
00012 #ifndef TA_FILESYSTEM_H
00013 #define TA_FILESYSTEM_H
00014 
00015 #ifndef TA_TYPES_H
00016 #include "Types.h"
00017 #endif // TA_TYPES_H
00018 
00019 #ifndef TA_SINGLETON_H
00020 #include "Singleton.h"
00021 #endif // TA_SINGLETON_H
00022 
00023 #ifndef TA_COMMON_H
00024 #include "Common.h"
00025 #endif // TA_COMMON_H
00026 
00027 namespace TA
00028 {
00029 
00030 class IOStreamInput;
00031 class Buffer;
00032 
00033 class TACOMMON_CLASS FileSystem
00034 {
00035     SINGLETON_DEFINE(FileSystem)
00036 public:
00037     FileSystem();
00038     ~FileSystem();
00039 
00040     void Initialise();
00041     void Finalise();
00042 
00043     bool RegisterZipFile(const Char* szZipFileName);
00044     void ScanForZipFiles();
00045 
00046     //---------------------------------------------------------------------------------
00047     // If the file exists IOInputStream is returned.
00048     // If it doesn't exists, the file is looked for in registered zip files
00049     // where the zip file name minus the extention is treated like a directory name.
00050     //---------------------------------------------------------------------------------
00051     IOStreamInput* OpenInputStream(const Char* szFileName);
00052     void CloseInputStream(IOStreamInput* pIOInputStream);
00053 
00054     bool Exists(const Char* szFileName);
00055 
00056     //---------------------------------------------------------------------------------
00057     // If the file exists Buffer is returned.
00058     // If it doesn't exists, the file is looked for in registered zip files
00059     // where the zip file name minus the extention is treated like a directory name.
00060     //---------------------------------------------------------------------------------
00061     Buffer* ReadFileToBuffer(const Char* szFileName);
00062 
00063 private:
00064     struct Data;
00065     Data* m_pData;
00066 
00067     void ScanForZipFilesInternal(char *szThisPath, const char* szCurrentWorkingDir);
00068 };
00069 
00070 }
00071 
00072 #endif // TA_FILESYSTEM_H


© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.