Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1027 lines
40 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef FILESYSTEM_H
  8. #define FILESYSTEM_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <limits.h>
  13. #include "tier0/threadtools.h"
  14. #include "tier0/memalloc.h"
  15. #include "tier0/tslist.h"
  16. #include "tier1/interface.h"
  17. #include "tier1/utlsymbol.h"
  18. #include "tier1/utlstring.h"
  19. #include "tier1/functors.h"
  20. #include "tier1/checksum_crc.h"
  21. #include "tier1/checksum_md5.h"
  22. #include "tier1/utlqueue.h"
  23. #include "appframework/iappsystem.h"
  24. #include "tier2/tier2.h"
  25. #ifdef _PS3
  26. #include <sysutil/sysutil_syscache.h>
  27. #include <sysutil/sysutil_gamecontent.h>
  28. struct HddCacheFileStatus;
  29. extern char gSrcGameDataPath[];
  30. class CFileGroupSystem;
  31. #endif
  32. //-----------------------------------------------------------------------------
  33. // Forward declarations
  34. //-----------------------------------------------------------------------------
  35. class CUtlBuffer;
  36. class KeyValues;
  37. class IFileList;
  38. typedef void * FileHandle_t;
  39. typedef int FileFindHandle_t;
  40. typedef void (*FileSystemLoggingFunc_t)( const char *fileName, const char *accessType );
  41. typedef int WaitForResourcesHandle_t;
  42. #ifdef _X360
  43. typedef void* HANDLE;
  44. #endif
  45. //-----------------------------------------------------------------------------
  46. // Enums used by the interface
  47. //-----------------------------------------------------------------------------
  48. #define FILESYSTEM_MAX_SEARCH_PATHS 128
  49. enum FileSystemSeek_t
  50. {
  51. FILESYSTEM_SEEK_HEAD = SEEK_SET,
  52. FILESYSTEM_SEEK_CURRENT = SEEK_CUR,
  53. FILESYSTEM_SEEK_TAIL = SEEK_END,
  54. };
  55. enum
  56. {
  57. FILESYSTEM_INVALID_FIND_HANDLE = -1
  58. };
  59. enum FileWarningLevel_t
  60. {
  61. // A problem!
  62. FILESYSTEM_WARNING = -1,
  63. // Don't print anything
  64. FILESYSTEM_WARNING_QUIET = 0,
  65. // On shutdown, report names of files left unclosed
  66. FILESYSTEM_WARNING_REPORTUNCLOSED,
  67. // Report number of times a file was opened, closed
  68. FILESYSTEM_WARNING_REPORTUSAGE,
  69. // Report all open/close events to console ( !slow! )
  70. FILESYSTEM_WARNING_REPORTALLACCESSES,
  71. // Report all open/close/read events to the console ( !slower! )
  72. FILESYSTEM_WARNING_REPORTALLACCESSES_READ,
  73. // Report all open/close/read/write events to the console ( !slower! )
  74. FILESYSTEM_WARNING_REPORTALLACCESSES_READWRITE,
  75. // Report all open/close/read/write events and all async I/O file events to the console ( !slower(est)! )
  76. FILESYSTEM_WARNING_REPORTALLACCESSES_ASYNC,
  77. };
  78. // search path filtering
  79. enum PathTypeFilter_t
  80. {
  81. FILTER_NONE = 0, // no filtering, all search path types match
  82. FILTER_CULLPACK = 1, // pack based search paths are culled (maps and zips)
  83. FILTER_CULLNONPACK = 2, // non-pack based search paths are culled
  84. FILTER_CULLLOCALIZED = 3, // Ignore localized paths, assumes CULLNONPACK
  85. FILTER_CULLLOCALIZED_ANY = 4, // Ignore any localized paths
  86. };
  87. // search path querying (bit flags)
  88. enum
  89. {
  90. PATH_IS_NORMAL = 0x00, // normal path, not pack based
  91. PATH_IS_PACKFILE = 0x01, // path is a pack file
  92. PATH_IS_MAPPACKFILE = 0x02, // path is a map pack file
  93. PATH_IS_DVDDEV = 0x04, // path is the dvddev cache
  94. };
  95. typedef uint32 PathTypeQuery_t;
  96. #define IS_PACKFILE( n ) ( n & ( PATH_IS_PACKFILE | PATH_IS_MAPPACKFILE ) )
  97. #define IS_DVDDEV( n ) ( n & PATH_IS_DVDDEV )
  98. enum DVDMode_t
  99. {
  100. DVDMODE_OFF = 0, // not using dvd
  101. DVDMODE_STRICT = 1, // dvd device only
  102. DVDMODE_DEV = 2, // dev mode, mutiple devices ok
  103. DVDMODE_DEV_VISTA = 3, // dev mode from a vista host, mutiple devices ok
  104. };
  105. #ifdef _PS3
  106. enum FsState_t
  107. {
  108. FS_STATE_INIT = 0,
  109. FS_STATE_LEVEL_LOAD = 1,
  110. FS_STATE_LEVEL_RUN = 2,
  111. FS_STATE_LEVEL_RESTORE = 3,
  112. FS_STATE_LEVEL_LOAD_END = 4,
  113. FS_STATE_EXITING = 5
  114. };
  115. enum Ps3FileType_t
  116. {
  117. PS3_FILETYPE_WAV,
  118. PS3_FILETYPE_ANI,
  119. PS3_FILETYPE_BSP,
  120. PS3_FILETYPE_VMT,
  121. PS3_FILETYPE_QPRE,
  122. PS3_FILETYPE_OTHER,
  123. PS3_FILETYPE_DIR,
  124. PS3_FILETYPE_UNKNOWN
  125. };
  126. #endif
  127. // In non-retail builds, enable the file blocking access tracking stuff...
  128. #if defined( TRACK_BLOCKING_IO )
  129. enum FileBlockingWarning_t
  130. {
  131. // Report how long synchronous i/o took to complete
  132. FILESYSTEM_BLOCKING_SYNCHRONOUS = 0,
  133. // Report how long async i/o took to complete if AsyncFileFinished caused it to load via "blocking" i/o
  134. FILESYSTEM_BLOCKING_ASYNCHRONOUS_BLOCK,
  135. // Report how long async i/o took to complete
  136. FILESYSTEM_BLOCKING_ASYNCHRONOUS,
  137. // Report how long the async "callback" took
  138. FILESYSTEM_BLOCKING_CALLBACKTIMING,
  139. FILESYSTEM_BLOCKING_NUMBINS,
  140. };
  141. #pragma pack(1)
  142. class FileBlockingItem
  143. {
  144. public:
  145. enum
  146. {
  147. FB_ACCESS_OPEN = 1,
  148. FB_ACCESS_CLOSE = 2,
  149. FB_ACCESS_READ = 3,
  150. FB_ACCESS_WRITE = 4,
  151. FB_ACCESS_APPEND = 5,
  152. FB_ACCESS_SIZE = 6
  153. };
  154. FileBlockingItem() :
  155. m_ItemType( (FileBlockingWarning_t)0 ),
  156. m_flElapsed( 0.0f ),
  157. m_nAccessType( 0 )
  158. {
  159. SetFileName( NULL );
  160. }
  161. FileBlockingItem( int type, char const *filename, float elapsed, int accessType ) :
  162. m_ItemType( (FileBlockingWarning_t)type ),
  163. m_flElapsed( elapsed ),
  164. m_nAccessType( accessType )
  165. {
  166. SetFileName( filename );
  167. }
  168. void SetFileName( char const *filename )
  169. {
  170. if ( !filename )
  171. {
  172. m_szFilename[ 0 ] = 0;
  173. return;
  174. }
  175. int len = Q_strlen( filename );
  176. if ( len >= sizeof( m_szFilename ) )
  177. {
  178. Q_strncpy( m_szFilename, &filename[ len - sizeof( m_szFilename ) + 1 ], sizeof( m_szFilename ) );
  179. }
  180. else
  181. {
  182. Q_strncpy( m_szFilename, filename, sizeof( m_szFilename ) );
  183. }
  184. }
  185. char const *GetFileName() const
  186. {
  187. return m_szFilename;
  188. }
  189. FileBlockingWarning_t m_ItemType;
  190. float m_flElapsed;
  191. byte m_nAccessType;
  192. private:
  193. char m_szFilename[ 32 ];
  194. };
  195. #pragma pack()
  196. class IBlockingFileItemList
  197. {
  198. public:
  199. // You can't call any of the below calls without locking first
  200. virtual void LockMutex() = 0;
  201. virtual void UnlockMutex() = 0;
  202. virtual int First() const = 0;
  203. virtual int Next( int i ) const = 0;
  204. virtual int InvalidIndex() const = 0;
  205. virtual const FileBlockingItem& Get( int index ) const = 0;
  206. virtual void Reset() = 0;
  207. };
  208. #endif // TRACK_BLOCKING_IO
  209. enum FilesystemMountRetval_t
  210. {
  211. FILESYSTEM_MOUNT_OK = 0,
  212. FILESYSTEM_MOUNT_FAILED,
  213. };
  214. enum SearchPathAdd_t
  215. {
  216. PATH_ADD_TO_HEAD, // First path searched
  217. PATH_ADD_TO_TAIL, // Last path searched
  218. PATH_ADD_TO_TAIL_ATINDEX, // First path searched
  219. };
  220. enum FilesystemOpenExFlags_t
  221. {
  222. FSOPEN_UNBUFFERED = (1 << 0),
  223. FSOPEN_FORCE_TRACK_CRC = (1 << 1), // This makes it calculate a CRC for the file (if the file came from disk) regardless
  224. // of the IFileList passed to RegisterFileWhitelist.
  225. FSOPEN_NEVERINPACK = (1 << 2), // 360 only, hint to FS that file is not allowed to be in pack file
  226. };
  227. #define FILESYSTEM_INVALID_HANDLE ( FileHandle_t )0
  228. //-----------------------------------------------------------------------------
  229. // Structures used by the interface
  230. //-----------------------------------------------------------------------------
  231. struct FileSystemStatistics
  232. {
  233. CInterlockedUInt nReads,
  234. nWrites,
  235. nBytesRead,
  236. nBytesWritten,
  237. nSeeks;
  238. };
  239. //-----------------------------------------------------------------------------
  240. // File system allocation functions. Client must free on failure
  241. //-----------------------------------------------------------------------------
  242. typedef void *(*FSAllocFunc_t)( const char *pszFilename, unsigned nBytes );
  243. //-----------------------------------------------------------------------------
  244. // Used to display dirty disk error functions
  245. //-----------------------------------------------------------------------------
  246. typedef void (*FSDirtyDiskReportFunc_t)();
  247. //-----------------------------------------------------------------------------
  248. // Asynchronous support types
  249. //-----------------------------------------------------------------------------
  250. DECLARE_POINTER_HANDLE(FSAsyncControl_t);
  251. DECLARE_POINTER_HANDLE(FSAsyncFile_t);
  252. const FSAsyncFile_t FS_INVALID_ASYNC_FILE = (FSAsyncFile_t)(0x0000ffff);
  253. //---------------------------------------------------------
  254. // Async file status
  255. //---------------------------------------------------------
  256. enum FSAsyncStatus_t
  257. {
  258. FSASYNC_ERR_ALIGNMENT = -6, // read parameters invalid for unbuffered IO
  259. FSASYNC_ERR_FAILURE = -5, // hard subsystem failure
  260. FSASYNC_ERR_READING = -4, // read error on file
  261. FSASYNC_ERR_NOMEMORY = -3, // out of memory for file read
  262. FSASYNC_ERR_UNKNOWNID = -2, // caller's provided id is not recognized
  263. FSASYNC_ERR_FILEOPEN = -1, // filename could not be opened (bad path, not exist, etc)
  264. FSASYNC_OK = 0, // operation is successful
  265. FSASYNC_STATUS_PENDING, // file is properly queued, waiting for service
  266. FSASYNC_STATUS_INPROGRESS, // file is being accessed
  267. FSASYNC_STATUS_ABORTED, // file was aborted by caller
  268. FSASYNC_STATUS_UNSERVICED, // file is not yet queued
  269. };
  270. //---------------------------------------------------------
  271. // Async request flags
  272. //---------------------------------------------------------
  273. enum FSAsyncFlags_t
  274. {
  275. FSASYNC_FLAGS_ALLOCNOFREE = ( 1 << 0 ), // do the allocation for dataPtr, but don't free
  276. FSASYNC_FLAGS_FREEDATAPTR = ( 1 << 1 ), // free the memory for the dataPtr post callback
  277. FSASYNC_FLAGS_SYNC = ( 1 << 2 ), // Actually perform the operation synchronously. Used to simplify client code paths
  278. FSASYNC_FLAGS_NULLTERMINATE = ( 1 << 3 ), // allocate an extra byte and null terminate the buffer read in
  279. };
  280. //---------------------------------------------------------
  281. // Return value for CheckFileCRC.
  282. //---------------------------------------------------------
  283. enum EFileCRCStatus
  284. {
  285. k_eFileCRCStatus_CantOpenFile, // We don't have this file.
  286. k_eFileCRCStatus_GotCRC,
  287. k_eFileCRCStatus_FileInVPK,
  288. };
  289. // Used in CacheFileCRCs.
  290. enum ECacheCRCType
  291. {
  292. k_eCacheCRCType_SingleFile,
  293. k_eCacheCRCType_Directory,
  294. k_eCacheCRCType_Directory_Recursive
  295. };
  296. //---------------------------------------------------------
  297. // Optional completion callback for each async file serviced (or failed)
  298. // call is not reentrant, async i/o guaranteed suspended until return
  299. // Note: If you change the signature of the callback, you will have to account for it in FileSystemV12 (toml [4/18/2005] )
  300. //---------------------------------------------------------
  301. struct FileAsyncRequest_t;
  302. typedef void (*FSAsyncCallbackFunc_t)(const FileAsyncRequest_t &request, int nBytesRead, FSAsyncStatus_t err);
  303. //-----------------------------------------------------------------------------
  304. // Used to add results from async directory scans
  305. //-----------------------------------------------------------------------------
  306. typedef void (*FSAsyncScanAddFunc_t)( void* pContext, char* pFoundPath, char* pFoundFile );
  307. typedef void (*FSAsyncScanCompleteFunc_t)( void* pContext, FSAsyncStatus_t err );
  308. //---------------------------------------------------------
  309. // Description of an async request
  310. //---------------------------------------------------------
  311. struct FileAsyncRequest_t
  312. {
  313. FileAsyncRequest_t() { memset( this, 0, sizeof(*this) ); hSpecificAsyncFile = FS_INVALID_ASYNC_FILE; }
  314. const char * pszFilename; // file system name
  315. void * pData; // optional, system will alloc/free if NULL
  316. int nOffset; // optional initial seek_set, 0=beginning
  317. int nBytes; // optional read clamp, -1=exist test, 0=full read
  318. FSAsyncCallbackFunc_t pfnCallback; // optional completion callback
  319. void * pContext; // caller's unique file identifier
  320. int priority; // inter list priority, 0=lowest
  321. unsigned flags; // behavior modifier
  322. const char * pszPathID; // path ID (NOTE: this field is here to remain binary compatible with release HL2 filesystem interface)
  323. FSAsyncFile_t hSpecificAsyncFile; // Optional hint obtained using AsyncBeginRead()
  324. FSAllocFunc_t pfnAlloc; // custom allocator. can be null. not compatible with FSASYNC_FLAGS_FREEDATAPTR
  325. };
  326. struct FileHash_t
  327. {
  328. enum EFileHashType_t
  329. {
  330. k_EFileHashTypeUnknown = 0,
  331. k_EFileHashTypeEntireFile = 1,
  332. k_EFileHashTypeIncompleteFile = 2,
  333. };
  334. FileHash_t()
  335. {
  336. m_eFileHashType = FileHash_t::k_EFileHashTypeUnknown;
  337. m_cbFileLen = 0;
  338. m_PackFileID = 0;
  339. m_nPackFileNumber = 0;
  340. }
  341. int m_eFileHashType;
  342. CRC32_t m_crcIOSequence;
  343. MD5Value_t m_md5contents;
  344. int m_cbFileLen;
  345. int m_PackFileID;
  346. int m_nPackFileNumber;
  347. bool operator==( const FileHash_t &src ) const
  348. {
  349. return m_crcIOSequence == src.m_crcIOSequence &&
  350. m_md5contents == src.m_md5contents &&
  351. m_eFileHashType == src.m_eFileHashType;
  352. }
  353. bool operator!=( const FileHash_t &src ) const
  354. {
  355. return m_crcIOSequence != src.m_crcIOSequence ||
  356. m_md5contents != src.m_md5contents ||
  357. m_eFileHashType != src.m_eFileHashType;
  358. }
  359. };
  360. class CUnverifiedFileHash
  361. {
  362. public:
  363. char m_PathID[MAX_PATH];
  364. char m_Filename[MAX_PATH];
  365. int m_nFileFraction;
  366. FileHash_t m_FileHash;
  367. };
  368. class CUnverifiedCRCFile
  369. {
  370. public:
  371. char m_PathID[MAX_PATH];
  372. char m_Filename[MAX_PATH];
  373. CRC32_t m_CRC;
  374. };
  375. // Spew flags for SetWhitelistSpewFlags (set with the fs_whitelist_spew_flags cvar).
  376. // Update the comment for the fs_whitelist_spew_flags cvar if you change these.
  377. #define WHITELIST_SPEW_WHILE_LOADING 0x0001 // list files as they are added to the CRC tracker
  378. #define WHITELIST_SPEW_RELOAD_FILES 0x0002 // show files the filesystem is telling the engine to reload
  379. #define WHITELIST_SPEW_DONT_RELOAD_FILES 0x0004 // show files the filesystem is NOT telling the engine to reload
  380. // DLC license mask flags is 32 publisher defined bits
  381. // MSW 16 bits in 8.8: Type.SubVersion
  382. // LSW 16 bits: Flags
  383. // return id component
  384. #define DLC_LICENSE_ID( x ) ( ( ( (unsigned int)( x ) ) >> 24 ) & 0x000000FF )
  385. // returns minor version component (not generally used, i.e. we dont rev dlc's yet)
  386. #define DLC_LICENSE_MINORVERSION( x ) ( ( ( (unsigned int)( x ) ) >> 16 ) & 0x000000FF )
  387. // returns license flags
  388. #define DLC_LICENSE_FLAGS( x ) ( ( ( (unsigned int)( x ) ) & 0x0000FFFF ) )
  389. #define DLCFLAGS_PRESENCE_ONLY 0x0001 // causes no search path loadout
  390. //-----------------------------------------------------------------------------
  391. // Base file system interface
  392. //-----------------------------------------------------------------------------
  393. // This is the minimal interface that can be implemented to provide access to
  394. // a named set of files.
  395. #define BASEFILESYSTEM_INTERFACE_VERSION "VBaseFileSystem011"
  396. // This interface is for VPK files to communicate with FileTracker
  397. abstract_class IThreadedFileMD5Processor
  398. {
  399. public:
  400. virtual int SubmitThreadedMD5Request( uint8 *pubBuffer, int cubBuffer, int PackFileID, int nPackFileNumber, int nPackFileFraction ) = 0;
  401. virtual bool BlockUntilMD5RequestComplete( int iRequest, MD5Value_t *pMd5ValueOut ) = 0;
  402. virtual bool IsMD5RequestComplete( int iRequest, MD5Value_t *pMd5ValueOut ) = 0;
  403. };
  404. abstract_class IBaseFileSystem
  405. {
  406. public:
  407. virtual int Read( void* pOutput, int size, FileHandle_t file ) = 0;
  408. virtual int Write( void const* pInput, int size, FileHandle_t file ) = 0;
  409. // if pathID is NULL, all paths will be searched for the file
  410. virtual FileHandle_t Open( const char *pFileName, const char *pOptions, const char *pathID = 0 ) = 0;
  411. virtual void Close( FileHandle_t file ) = 0;
  412. virtual void Seek( FileHandle_t file, int pos, FileSystemSeek_t seekType ) = 0;
  413. virtual unsigned int Tell( FileHandle_t file ) = 0;
  414. virtual unsigned int Size( FileHandle_t file ) = 0;
  415. virtual unsigned int Size( const char *pFileName, const char *pPathID = 0 ) = 0;
  416. virtual void Flush( FileHandle_t file ) = 0;
  417. virtual bool Precache( const char *pFileName, const char *pPathID = 0 ) = 0;
  418. virtual bool FileExists( const char *pFileName, const char *pPathID = 0 ) = 0;
  419. virtual bool IsFileWritable( char const *pFileName, const char *pPathID = 0 ) = 0;
  420. virtual bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID = 0 ) = 0;
  421. virtual long GetFileTime( const char *pFileName, const char *pPathID = 0 ) = 0;
  422. //--------------------------------------------------------
  423. // Reads/writes files to utlbuffers. Use this for optimal read performance when doing open/read/close
  424. //--------------------------------------------------------
  425. virtual bool ReadFile( const char *pFileName, const char *pPath, CUtlBuffer &buf, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) = 0;
  426. virtual bool WriteFile( const char *pFileName, const char *pPath, CUtlBuffer &buf ) = 0;
  427. virtual bool UnzipFile( const char *pFileName, const char *pPath, const char *pDestination ) = 0;
  428. };
  429. abstract_class IIoStats
  430. {
  431. public:
  432. virtual void OnFileSeek( int nTimeInMs ) = 0;
  433. virtual void OnFileRead( int nTimeInMs, int nBytesRead ) = 0;
  434. virtual void OnFileOpen( const char * pFileName ) = 0;
  435. virtual int GetNumberOfFileSeeks() = 0;
  436. virtual int GetTimeInFileSeek() = 0;
  437. virtual int GetNumberOfFileReads() = 0;
  438. virtual int GetTimeInFileReads() = 0;
  439. virtual int GetFileReadTotalSize() = 0;
  440. virtual int GetNumberOfFileOpens() = 0;
  441. virtual void Reset() = 0;
  442. protected:
  443. virtual ~IIoStats()
  444. {
  445. // Do nothing...
  446. }
  447. };
  448. //-----------------------------------------------------------------------------
  449. // Main file system interface
  450. //-----------------------------------------------------------------------------
  451. abstract_class IFileSystem : public IAppSystem, public IBaseFileSystem
  452. {
  453. public:
  454. //--------------------------------------------------------
  455. // Steam operations
  456. //--------------------------------------------------------
  457. virtual bool IsSteam() const = 0;
  458. // Supplying an extra app id will mount this app in addition
  459. // to the one specified in the environment variable "steamappid"
  460. //
  461. // If nExtraAppId is < -1, then it will mount that app ID only.
  462. // (Was needed by the dedicated server b/c the "SteamAppId" env var only gets passed to steam.dll
  463. // at load time, so the dedicated couldn't pass it in that way).
  464. virtual FilesystemMountRetval_t MountSteamContent( int nExtraAppId = -1 ) = 0;
  465. //--------------------------------------------------------
  466. // Search path manipulation
  467. //--------------------------------------------------------
  468. // Add paths in priority order (mod dir, game dir, ....)
  469. // If one or more .pak files are in the specified directory, then they are
  470. // added after the file system path
  471. // If the path is the relative path to a .bsp file, then any previous .bsp file
  472. // override is cleared and the current .bsp is searched for an embedded PAK file
  473. // and this file becomes the highest priority search path ( i.e., it's looked at first
  474. // even before the mod's file system path ).
  475. virtual void AddSearchPath( const char *pPath, const char *pathID, SearchPathAdd_t addType = PATH_ADD_TO_TAIL ) = 0;
  476. virtual bool RemoveSearchPath( const char *pPath, const char *pathID = 0 ) = 0;
  477. // Remove all search paths (including write path?)
  478. virtual void RemoveAllSearchPaths( void ) = 0;
  479. // Remove search paths associated with a given pathID
  480. virtual void RemoveSearchPaths( const char *szPathID ) = 0;
  481. // This is for optimization. If you mark a path ID as "by request only", then files inside it
  482. // will only be accessed if the path ID is specifically requested. Otherwise, it will be ignored.
  483. // If there are currently no search paths with the specified path ID, then it will still
  484. // remember it in case you add search paths with this path ID.
  485. virtual void MarkPathIDByRequestOnly( const char *pPathID, bool bRequestOnly ) = 0;
  486. virtual bool IsFileInReadOnlySearchPath(const char *pPath, const char *pathID = 0) = 0;
  487. // converts a partial path into a full path
  488. virtual const char *RelativePathToFullPath( const char *pFileName, const char *pPathID, char *pLocalPath, int localPathBufferSize, PathTypeFilter_t pathFilter = FILTER_NONE, PathTypeQuery_t *pPathType = NULL ) = 0;
  489. #if IsGameConsole()
  490. // Given a relative path, gets the PACK file that contained this file and its offset and size. Can be used to prefetch a file to a HDD for caching reason.
  491. virtual bool GetPackFileInfoFromRelativePath( const char *pFileName, const char *pPathID, char *pPackPath, int nPackPathBufferSize, int64 &nPosition, int64 &nLength ) = 0;
  492. #endif
  493. // Returns the search path, each path is separated by ;s. Returns the length of the string returned
  494. virtual int GetSearchPath( const char *pathID, bool bGetPackFiles, char *pPath, int nMaxLen ) = 0;
  495. // interface for custom pack files > 4Gb
  496. virtual bool AddPackFile( const char *fullpath, const char *pathID ) = 0;
  497. //--------------------------------------------------------
  498. // File manipulation operations
  499. //--------------------------------------------------------
  500. // Deletes a file (on the WritePath)
  501. virtual void RemoveFile( char const* pRelativePath, const char *pathID = 0 ) = 0;
  502. // Renames a file (on the WritePath)
  503. virtual bool RenameFile( char const *pOldPath, char const *pNewPath, const char *pathID = 0 ) = 0;
  504. // create a local directory structure
  505. virtual void CreateDirHierarchy( const char *path, const char *pathID = 0 ) = 0;
  506. // File I/O and info
  507. virtual bool IsDirectory( const char *pFileName, const char *pathID = 0 ) = 0;
  508. virtual void FileTimeToString( char* pStrip, int maxCharsIncludingTerminator, long fileTime ) = 0;
  509. //--------------------------------------------------------
  510. // Open file operations
  511. //--------------------------------------------------------
  512. virtual void SetBufferSize( FileHandle_t file, unsigned nBytes ) = 0;
  513. virtual bool IsOk( FileHandle_t file ) = 0;
  514. virtual bool EndOfFile( FileHandle_t file ) = 0;
  515. virtual char *ReadLine( char *pOutput, int maxChars, FileHandle_t file ) = 0;
  516. #if ! defined(SWIG)
  517. // Don't let SWIG see the PRINTF_FORMAT_STRING attribute or it will complain.
  518. virtual int FPrintf( FileHandle_t file, PRINTF_FORMAT_STRING const char *pFormat, ... ) FMTFUNCTION( 3, 4 ) = 0;
  519. #else
  520. virtual int FPrintf( FileHandle_t file, const char *pFormat, ... ) FMTFUNCTION( 3, 4 ) = 0;
  521. #endif
  522. //--------------------------------------------------------
  523. // Dynamic library operations
  524. //--------------------------------------------------------
  525. // load/unload modules
  526. virtual CSysModule *LoadModule( const char *pFileName, const char *pPathID = 0, bool bValidatedDllOnly = true ) = 0;
  527. virtual void UnloadModule( CSysModule *pModule ) = 0;
  528. //--------------------------------------------------------
  529. // File searching operations
  530. //--------------------------------------------------------
  531. // FindFirst/FindNext. Also see FindFirstEx.
  532. virtual const char *FindFirst( const char *pWildCard, FileFindHandle_t *pHandle ) = 0;
  533. virtual const char *FindNext( FileFindHandle_t handle ) = 0;
  534. virtual bool FindIsDirectory( FileFindHandle_t handle ) = 0;
  535. virtual void FindClose( FileFindHandle_t handle ) = 0;
  536. // Same as FindFirst, but you can filter by path ID, which can make it faster.
  537. virtual const char *FindFirstEx(
  538. const char *pWildCard,
  539. const char *pPathID,
  540. FileFindHandle_t *pHandle
  541. ) = 0;
  542. // Searches for a file in all paths and results absolute path names for the file, works in pack files (zip and vpk) too
  543. // Lets you search for something like sound/sound.cache and get a list of every sound cache
  544. virtual void FindFileAbsoluteList( CUtlVector< CUtlString > &outAbsolutePathNames, const char *pWildCard, const char *pPathID ) = 0;
  545. //--------------------------------------------------------
  546. // File name and directory operations
  547. //--------------------------------------------------------
  548. // FIXME: This method is obsolete! Use RelativePathToFullPath instead!
  549. // converts a partial path into a full path
  550. virtual const char *GetLocalPath( const char *pFileName, char *pLocalPath, int localPathBufferSize ) = 0;
  551. // Returns true on success ( based on current list of search paths, otherwise false if
  552. // it can't be resolved )
  553. virtual bool FullPathToRelativePath( const char *pFullpath, char *pRelative, int maxlen ) = 0;
  554. // Gets the current working directory
  555. virtual bool GetCurrentDirectory( char* pDirectory, int maxlen ) = 0;
  556. //--------------------------------------------------------
  557. // Filename dictionary operations
  558. //--------------------------------------------------------
  559. virtual FileNameHandle_t FindOrAddFileName( char const *pFileName ) = 0;
  560. virtual bool String( const FileNameHandle_t& handle, char *buf, int buflen ) = 0;
  561. //--------------------------------------------------------
  562. // Asynchronous file operations
  563. //--------------------------------------------------------
  564. //------------------------------------
  565. // Global operations
  566. //------------------------------------
  567. FSAsyncStatus_t AsyncRead( const FileAsyncRequest_t &request, FSAsyncControl_t *phControl = NULL ) { return AsyncReadMultiple( &request, 1, phControl ); }
  568. virtual FSAsyncStatus_t AsyncReadMultiple( const FileAsyncRequest_t *pRequests, int nRequests, FSAsyncControl_t *phControls = NULL ) = 0;
  569. virtual FSAsyncStatus_t AsyncAppend(const char *pFileName, const void *pSrc, int nSrcBytes, bool bFreeMemory, FSAsyncControl_t *pControl = NULL ) = 0;
  570. virtual FSAsyncStatus_t AsyncAppendFile(const char *pAppendToFileName, const char *pAppendFromFileName, FSAsyncControl_t *pControl = NULL ) = 0;
  571. virtual void AsyncFinishAll( int iToPriority = 0 ) = 0;
  572. virtual void AsyncFinishAllWrites() = 0;
  573. virtual FSAsyncStatus_t AsyncFlush() = 0;
  574. virtual bool AsyncSuspend() = 0;
  575. virtual bool AsyncResume() = 0;
  576. //------------------------------------
  577. // Functions to hold a file open if planning on doing mutiple reads. Use is optional,
  578. // and is taken only as a hint
  579. //------------------------------------
  580. virtual FSAsyncStatus_t AsyncBeginRead( const char *pszFile, FSAsyncFile_t *phFile ) = 0;
  581. virtual FSAsyncStatus_t AsyncEndRead( FSAsyncFile_t hFile ) = 0;
  582. //------------------------------------
  583. // Request management
  584. //------------------------------------
  585. virtual FSAsyncStatus_t AsyncFinish( FSAsyncControl_t hControl, bool wait = true ) = 0;
  586. virtual FSAsyncStatus_t AsyncGetResult( FSAsyncControl_t hControl, void **ppData, int *pSize ) = 0;
  587. virtual FSAsyncStatus_t AsyncAbort( FSAsyncControl_t hControl ) = 0;
  588. virtual FSAsyncStatus_t AsyncStatus( FSAsyncControl_t hControl ) = 0;
  589. // set a new priority for a file already in the queue
  590. virtual FSAsyncStatus_t AsyncSetPriority(FSAsyncControl_t hControl, int newPriority) = 0;
  591. virtual void AsyncAddRef( FSAsyncControl_t hControl ) = 0;
  592. virtual void AsyncRelease( FSAsyncControl_t hControl ) = 0;
  593. //--------------------------------------------------------
  594. // Remote resource management
  595. //--------------------------------------------------------
  596. // starts waiting for resources to be available
  597. // returns FILESYSTEM_INVALID_HANDLE if there is nothing to wait on
  598. virtual WaitForResourcesHandle_t WaitForResources( const char *resourcelist ) = 0;
  599. // get progress on waiting for resources; progress is a float [0, 1], complete is true on the waiting being done
  600. // returns false if no progress is available
  601. // any calls after complete is true or on an invalid handle will return false, 0.0f, true
  602. virtual bool GetWaitForResourcesProgress( WaitForResourcesHandle_t handle, float *progress /* out */ , bool *complete /* out */ ) = 0;
  603. // cancels a progress call
  604. virtual void CancelWaitForResources( WaitForResourcesHandle_t handle ) = 0;
  605. // hints that a set of files will be loaded in near future
  606. // HintResourceNeed() is not to be confused with resource precaching.
  607. virtual int HintResourceNeed( const char *hintlist, int forgetEverything ) = 0;
  608. // returns true if a file is on disk
  609. virtual bool IsFileImmediatelyAvailable(const char *pFileName) = 0;
  610. // copies file out of pak/bsp/steam cache onto disk (to be accessible by third-party code)
  611. virtual void GetLocalCopy( const char *pFileName ) = 0;
  612. //--------------------------------------------------------
  613. // Debugging operations
  614. //--------------------------------------------------------
  615. // Dump to printf/OutputDebugString the list of files that have not been closed
  616. virtual void PrintOpenedFiles( void ) = 0;
  617. virtual void PrintSearchPaths( void ) = 0;
  618. // output
  619. virtual void SetWarningFunc( void (*pfnWarning)( const char *fmt, ... ) ) = 0;
  620. virtual void SetWarningLevel( FileWarningLevel_t level ) = 0;
  621. virtual void AddLoggingFunc( void (*pfnLogFunc)( const char *fileName, const char *accessType ) ) = 0;
  622. virtual void RemoveLoggingFunc( FileSystemLoggingFunc_t logFunc ) = 0;
  623. // Returns the file system statistics retreived by the implementation. Returns NULL if not supported.
  624. virtual const FileSystemStatistics *GetFilesystemStatistics() = 0;
  625. #if defined( _PS3 )
  626. // EA cruft not used: virtual Ps3FileType_t GetPs3FileType(const char* path) = 0;
  627. virtual void LogFileAccess( const char *pFullFileName ) = 0;
  628. // Prefetches a full file in the HDD cache.
  629. virtual bool PrefetchFile( const char *pFileName, int nPriority, bool bPersist ) = 0;
  630. // Prefetches a file portion in the HDD cache.
  631. virtual bool PrefetchFile( const char *pFileName, int nPriority, bool bPersist, int64 nOffset, int64 nSize ) = 0;
  632. // Flushes the HDD cache.
  633. virtual void FlushCache() = 0;
  634. // Suspends all prefetches (like when the game is doing a file intensive operation not controlled by the HDD cache, like Bink movies).
  635. virtual void SuspendPrefetches( const char *pWhy ) = 0;
  636. // Resumes prefetches. This function has to to be called as many time as SuspendPrefetches() to effectively resumes prefetches.
  637. virtual void ResumePrefetches( const char * pWhy ) = 0;
  638. // Gets called when we are starting / ending a save (it allows the file system to reduce its HDD usage and use BluRay instead).
  639. virtual void OnSaveStateChanged( bool bSaving ) = 0;
  640. // Returns the prefetching state. If true, everything has been prefetched on the HDD.
  641. virtual bool IsPrefetchingDone() = 0;
  642. #endif //_PS3
  643. //--------------------------------------------------------
  644. // Start of new functions after Lost Coast release (7/05)
  645. //--------------------------------------------------------
  646. virtual FileHandle_t OpenEx( const char *pFileName, const char *pOptions, unsigned flags = 0, const char *pathID = 0, char **ppszResolvedFilename = NULL ) = 0;
  647. // Extended version of read provides more context to allow for more optimal reading
  648. virtual int ReadEx( void* pOutput, int sizeDest, int size, FileHandle_t file ) = 0;
  649. virtual int ReadFileEx( const char *pFileName, const char *pPath, void **ppBuf, bool bNullTerminate = false, bool bOptimalAlloc = false, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) = 0;
  650. virtual FileNameHandle_t FindFileName( char const *pFileName ) = 0;
  651. #if defined( TRACK_BLOCKING_IO )
  652. virtual void EnableBlockingFileAccessTracking( bool state ) = 0;
  653. virtual bool IsBlockingFileAccessEnabled() const = 0;
  654. virtual IBlockingFileItemList *RetrieveBlockingFileAccessInfo() = 0;
  655. #endif
  656. virtual void SetupPreloadData() = 0;
  657. virtual void DiscardPreloadData() = 0;
  658. // Fixme, we could do these via a string embedded into the compiled data, etc...
  659. enum KeyValuesPreloadType_t
  660. {
  661. TYPE_VMT,
  662. TYPE_SOUNDEMITTER,
  663. TYPE_SOUNDSCAPE,
  664. TYPE_SOUNDOPERATORS,
  665. NUM_PRELOAD_TYPES
  666. };
  667. // If the "PreloadedData" hasn't been purged, then this'll try and instance the KeyValues using the fast path of compiled keyvalues loaded during startup.
  668. // Otherwise, it'll just fall through to the regular KeyValues loading routines
  669. virtual KeyValues *LoadKeyValues( KeyValuesPreloadType_t type, char const *filename, char const *pPathID = 0 ) = 0;
  670. virtual bool LoadKeyValues( KeyValues& head, KeyValuesPreloadType_t type, char const *filename, char const *pPathID = 0 ) = 0;
  671. virtual FSAsyncStatus_t AsyncWrite(const char *pFileName, const void *pSrc, int nSrcBytes, bool bFreeMemory, bool bAppend = false, FSAsyncControl_t *pControl = NULL ) = 0;
  672. virtual FSAsyncStatus_t AsyncWriteFile(const char *pFileName, const CUtlBuffer *pSrc, int nSrcBytes, bool bFreeMemory, bool bAppend = false, FSAsyncControl_t *pControl = NULL ) = 0;
  673. // Async read functions with memory blame
  674. FSAsyncStatus_t AsyncReadCreditAlloc( const FileAsyncRequest_t &request, const char *pszFile, int line, FSAsyncControl_t *phControl = NULL ) { return AsyncReadMultipleCreditAlloc( &request, 1, pszFile, line, phControl ); }
  675. virtual FSAsyncStatus_t AsyncReadMultipleCreditAlloc( const FileAsyncRequest_t *pRequests, int nRequests, const char *pszFile, int line, FSAsyncControl_t *phControls = NULL ) = 0;
  676. virtual FSAsyncStatus_t AsyncDirectoryScan( const char* pSearchSpec, bool recurseFolders, void* pContext, FSAsyncScanAddFunc_t pfnAdd, FSAsyncScanCompleteFunc_t pfnDone, FSAsyncControl_t *pControl = NULL ) = 0;
  677. virtual bool GetFileTypeForFullPath( char const *pFullPath, wchar_t *buf, size_t bufSizeInBytes ) = 0;
  678. //--------------------------------------------------------
  679. //--------------------------------------------------------
  680. virtual bool ReadToBuffer( FileHandle_t hFile, CUtlBuffer &buf, int nMaxBytes = 0, FSAllocFunc_t pfnAlloc = NULL ) = 0;
  681. //--------------------------------------------------------
  682. // Optimal IO operations
  683. //--------------------------------------------------------
  684. virtual bool GetOptimalIOConstraints( FileHandle_t hFile, unsigned *pOffsetAlign, unsigned *pSizeAlign, unsigned *pBufferAlign ) = 0;
  685. inline unsigned GetOptimalReadSize( FileHandle_t hFile, unsigned nLogicalSize );
  686. virtual void *AllocOptimalReadBuffer( FileHandle_t hFile, unsigned nSize = 0, unsigned nOffset = 0 ) = 0;
  687. virtual void FreeOptimalReadBuffer( void * ) = 0;
  688. //--------------------------------------------------------
  689. //
  690. //--------------------------------------------------------
  691. virtual void BeginMapAccess() = 0;
  692. virtual void EndMapAccess() = 0;
  693. // Returns true on success, otherwise false if it can't be resolved
  694. virtual bool FullPathToRelativePathEx( const char *pFullpath, const char *pPathId, char *pRelative, int maxlen ) = 0;
  695. virtual int GetPathIndex( const FileNameHandle_t &handle ) = 0;
  696. virtual long GetPathTime( const char *pPath, const char *pPathID ) = 0;
  697. virtual DVDMode_t GetDVDMode() = 0;
  698. //--------------------------------------------------------
  699. // Whitelisting for pure servers.
  700. //--------------------------------------------------------
  701. // This should be called ONCE at startup. Multiplayer games (gameinfo.txt does not contain singleplayer_only)
  702. // want to enable this so sv_pure works.
  703. virtual void EnableWhitelistFileTracking( bool bEnable, bool bCacheAllVPKHashes, bool bRecalculateAndCheckHashes ) = 0;
  704. // This is called when the client connects to a server using a pure_server_whitelist.txt file.
  705. //
  706. // Files listed in pWantCRCList will have CRCs calculated for them IF they come off disk
  707. // (and those CRCs will come out of GetUnverifiedCRCFiles).
  708. //
  709. // Files listed in pAllowFromDiskList will be allowed to load from disk. All other files will
  710. // be forced to come from Steam.
  711. //
  712. // The filesystem hangs onto the whitelists you pass in here, and it will Release() them when it closes down
  713. // or when you call this function again.
  714. //
  715. // NOTE: The whitelists you pass in here will be accessed from multiple threads, so make sure the
  716. // IsFileInList function is thread safe.
  717. //
  718. // If pFilesToReload is non-null, the filesystem will hand back a list of files that should be reloaded because they
  719. // are now "dirty". For example, if you were on a non-pure server and you loaded a certain model, and then you connected
  720. // to a pure server that said that model had to come from Steam, then pFilesToReload would specify that model
  721. // and the engine should reload it so it can come from Steam.
  722. //
  723. // Be sure to call Release() on pFilesToReload.
  724. virtual void RegisterFileWhitelist( IFileList *pWantCRCList, IFileList *pAllowFromDiskList, IFileList **pFilesToReload ) = 0;
  725. // Called when the client logs onto a server. Any files that came off disk should be marked as
  726. // unverified because this server may have a different set of files it wants to guarantee.
  727. virtual void MarkAllCRCsUnverified() = 0;
  728. // As the server loads whitelists when it transitions maps, it calls this to calculate CRCs for any files marked
  729. // with check_crc. Then it calls CheckCachedFileCRC later when it gets client requests to verify CRCs.
  730. virtual void CacheFileCRCs( const char *pPathname, ECacheCRCType eType, IFileList *pFilter ) = 0;
  731. virtual EFileCRCStatus CheckCachedFileHash( const char *pPathID, const char *pRelativeFilename, int nFileFraction, FileHash_t *pFileHash ) = 0;
  732. // Fills in the list of files that have been loaded off disk and have not been verified.
  733. // Returns the number of files filled in (between 0 and nMaxFiles).
  734. //
  735. // This also removes any files it's returning from the unverified CRC list, so they won't be
  736. // returned from here again.
  737. // The client sends batches of these to the server to verify.
  738. virtual int GetUnverifiedFileHashes( CUnverifiedFileHash *pFiles, int nMaxFiles ) = 0;
  739. // Control debug message output.
  740. // Pass a combination of WHITELIST_SPEW_ flags.
  741. virtual int GetWhitelistSpewFlags() = 0;
  742. virtual void SetWhitelistSpewFlags( int flags ) = 0;
  743. // Installs a callback used to display a dirty disk dialog
  744. virtual void InstallDirtyDiskReportFunc( FSDirtyDiskReportFunc_t func ) = 0;
  745. virtual bool IsLaunchedFromXboxHDD() = 0;
  746. virtual bool IsInstalledToXboxHDDCache() = 0;
  747. virtual bool IsDVDHosted() = 0;
  748. virtual bool IsInstallAllowed() = 0;
  749. virtual int GetSearchPathID( char *pPath, int nMaxLen ) = 0;
  750. virtual bool FixupSearchPathsAfterInstall() = 0;
  751. virtual FSDirtyDiskReportFunc_t GetDirtyDiskReportFunc() = 0;
  752. virtual void AddVPKFile( char const *pszName, SearchPathAdd_t addType = PATH_ADD_TO_TAIL ) = 0;
  753. virtual void RemoveVPKFile( char const *pszName ) = 0;
  754. virtual void GetVPKFileNames( CUtlVector<CUtlString> &destVector ) = 0;
  755. virtual void RemoveAllMapSearchPaths() = 0;
  756. virtual void SyncDvdDevCache() = 0;
  757. virtual bool GetStringFromKVPool( CRC32_t poolKey, unsigned int key, char *pOutBuff, int buflen ) = 0;
  758. virtual bool DiscoverDLC( int iController ) = 0;
  759. virtual int IsAnyDLCPresent( bool *pbDLCSearchPathMounted = NULL ) = 0;
  760. virtual bool GetAnyDLCInfo( int iDLC, unsigned int *pLicenseMask, wchar_t *pTitleBuff, int nOutTitleSize ) = 0;
  761. virtual int IsAnyCorruptDLC() = 0;
  762. virtual bool GetAnyCorruptDLCInfo( int iCorruptDLC, wchar_t *pTitleBuff, int nOutTitleSize ) = 0;
  763. virtual bool AddDLCSearchPaths() = 0;
  764. virtual bool IsSpecificDLCPresent( unsigned int nDLCPackage ) = 0;
  765. // call this to look for CPU-hogs during loading processes. When you set this, a breakpoint
  766. // will be issued whenever the indicated # of seconds go by without an i/o request. Passing
  767. // 0.0 will turn off the functionality.
  768. virtual void SetIODelayAlarm( float flThreshhold ) = 0;
  769. virtual bool AddXLSPUpdateSearchPath( const void *pData, int nSize ) = 0;
  770. virtual IIoStats *GetIoStats() = 0;
  771. virtual void CacheAllVPKFileHashes( bool bCacheAllVPKHashes, bool bRecalculateAndCheckHashes ) = 0;
  772. virtual bool CheckVPKFileHash( int PackFileID, int nPackFileNumber, int nFileFraction, MD5Value_t &md5Value ) = 0;
  773. virtual void GetVPKFileStatisticsKV( KeyValues *pKV ) = 0;
  774. };
  775. //-----------------------------------------------------------------------------
  776. #if defined( _X360 ) && !defined( _CERT )
  777. extern char g_szXboxProfileLastFileOpened[MAX_PATH];
  778. #define SetLastProfileFileRead( s ) Q_strncpy( g_szXboxProfileLastFileOpened, sizeof( g_szXboxProfileLastFileOpened), pFileName )
  779. #define GetLastProfileFileRead() (&g_szXboxProfileLastFileOpened[0])
  780. #else
  781. #define SetLastProfileFileRead( s ) ((void)0)
  782. #define GetLastProfileFileRead() NULL
  783. #endif
  784. #if defined( _X360 ) && defined( _BASETSD_H_ )
  785. class CXboxDiskCacheSetter
  786. {
  787. public:
  788. CXboxDiskCacheSetter( SIZE_T newSize )
  789. {
  790. m_oldSize = XGetFileCacheSize();
  791. XSetFileCacheSize( newSize );
  792. }
  793. ~CXboxDiskCacheSetter()
  794. {
  795. XSetFileCacheSize( m_oldSize );
  796. }
  797. private:
  798. SIZE_T m_oldSize;
  799. };
  800. #define DISK_INTENSIVE() CXboxDiskCacheSetter cacheSetter( 1024*1024 )
  801. #else
  802. #define DISK_INTENSIVE() ((void)0)
  803. #endif
  804. //-----------------------------------------------------------------------------
  805. inline unsigned IFileSystem::GetOptimalReadSize( FileHandle_t hFile, unsigned nLogicalSize )
  806. {
  807. unsigned align;
  808. if ( GetOptimalIOConstraints( hFile, &align, NULL, NULL ) )
  809. return AlignValue( nLogicalSize, align );
  810. else
  811. return nLogicalSize;
  812. }
  813. //-----------------------------------------------------------------------------
  814. // We include this here so it'll catch compile errors in VMPI early.
  815. #include "filesystem_passthru.h"
  816. //-----------------------------------------------------------------------------
  817. // Async memory tracking
  818. //-----------------------------------------------------------------------------
  819. #if (defined(_DEBUG) || defined(USE_MEM_DEBUG))
  820. #define AsyncRead( a, b ) AsyncReadCreditAlloc( a, __FILE__, __LINE__, b )
  821. #define AsyncReadMutiple( a, b, c ) AsyncReadMultipleCreditAlloc( a, b, __FILE__, __LINE__, c )
  822. #endif
  823. //-----------------------------------------------------------------------------
  824. // Globals Exposed
  825. //-----------------------------------------------------------------------------
  826. DECLARE_TIER2_INTERFACE( IFileSystem, g_pFullFileSystem );
  827. #endif // FILESYSTEM_H