#include
Public Types | |
enum | EPathResolutionRules { FLAGS_PATH_REAL = 1L << 16, FLAGS_COPY_DEST_ALWAYS = 1L << 17, FLAGS_ADD_TRAILING_SLASH = 1L << 18, FLAGS_NO_FULL_PATH = 1L << 21, FLAGS_REDIRECT_TO_DISC = 1L << 22, FLAGS_FOR_WRITING = 1L << 23, FLAGS_NO_LOWCASE = 1L << 24, FLAGS_PAK_IN_MEMORY = BIT(25), FLAGS_FILENAMES_AS_CRC32 = BIT(26), FLAGS_CHECK_MOD_PATHS = BIT(27), FLAGS_NEVER_IN_PAK = BIT(28), FLAGS_RESOLVE_TO_CACHE = BIT(29), FLAGS_PAK_IN_MEMORY_CPU = BIT(30) } |
Flags used in file path resolution rules. More... | |
enum | EFOpenFlags { FOPEN_HINT_DIRECT_OPERATION = BIT(0), FOPEN_HINT_QUIET = BIT(1), FOPEN_ONDISK = BIT(2), FOPEN_FORSTREAMING = BIT(3), FOPEN_LOCKED_OPEN = BIT(4) } |
Used for widening FOpen functionality. They're ignored for the regular File System files. More... | |
enum | ERecordFileOpenList { RFOM_Disabled, RFOM_EngineStartup, RFOM_Level, RFOM_NextLevel } |
enum | { g_nMaxPath = 0x800 } |
The size of the buffer that receives the full path to the file. | |
enum | EFileSearchLocation { eFileLocation_Any = 0, eFileLocation_OnDisk, eFileLocation_InPak } |
File location enum used in isFileExist to control where the pak system looks for the file. | |
enum | EInMemoryPakLocation { eInMemoryPakLocale_Unload = 0, eInMemoryPakLocale_CPU, eInMemoryPakLocale_GPU } |
typedef uint64 | FileTime |
typedef int64 | SignedFileSize |
typedef std::function< void(const ArchiveEntryInfo &)> | ArchiveEntrySinkFunction |
Public Member Functions | |
virtual const char * | AdjustFileName (const char *src, char dst[g_nMaxPath], unsigned nFlags)=0 |
virtual bool | Init (const char *szBasePath)=0 |
virtual void | Release ()=0 |
virtual bool | IsInstalledToHDD (const char *acFilePath=0) const =0 |
virtual bool | OpenPack (const char *pName, unsigned nFlags=FLAGS_PATH_REAL, IMemoryBlock *pData=0, CryFixedStringT< ICryPak::g_nMaxPath > *pFullPath=0)=0 |
virtual bool | OpenPack (const char *pBindingRoot, const char *pName, unsigned nFlags=FLAGS_PATH_REAL, IMemoryBlock *pData=0, CryFixedStringT< ICryPak::g_nMaxPath > *pFullPath=0)=0 |
After this call, the pak file will be searched for files when they aren't on the OS file system. | |
virtual bool | ClosePack (const char *pName, unsigned nFlags=FLAGS_PATH_REAL)=0 |
After this call, the file will be unlocked and closed, and its contents won't be used to search for files. | |
virtual bool | OpenPacks (const char *pWildcard, unsigned nFlags=FLAGS_PATH_REAL, std::vector< CryFixedStringT< ICryPak::g_nMaxPath >> *pFullPaths=NULL)=0 |
Opens pack files by the path and wildcard. | |
virtual bool | OpenPacks (const char *pBindingRoot, const char *pWildcard, unsigned nFlags=FLAGS_PATH_REAL, std::vector< CryFixedStringT< ICryPak::g_nMaxPath >> *pFullPaths=NULL)=0 |
Opens pack files by the path and wildcard. | |
virtual bool | ClosePacks (const char *pWildcard, unsigned nFlags=FLAGS_PATH_REAL)=0 |
Closes pack files by the path and wildcard. | |
virtual bool | FindPacks (const char *pWildcardIn)=0 |
virtual bool | SetPacksAccessible (bool bAccessible, const char *pWildcard, unsigned nFlags=FLAGS_PATH_REAL)=0 |
Set access status of a pak files with a wildcard. | |
virtual bool | SetPackAccessible (bool bAccessible, const char *pName, unsigned nFlags=FLAGS_PATH_REAL)=0 |
Set access status of a pack file. | |
virtual void | SetPacksAccessibleForLevel (const char *sLevelName)=0 |
virtual bool | LoadPakToMemory (const char *pName, EInMemoryPakLocation eLoadToMemory, IMemoryBlock *pMemoryBlock=NULL)=0 |
Load or unload pak file completely to memory. | |
virtual void | LoadPaksToMemory (int nMaxPakSize, bool bLoadToMemory)=0 |
virtual void | AddMod (const char *szMod)=0 |
Adds a mod to the list. | |
virtual void | RemoveMod (const char *szMod)=0 |
Removes a mod from the list. | |
virtual const char * | GetMod (int index)=0 |
virtual void | ParseAliases (const char *szCommandLine)=0 |
Processes an alias command line containing multiple aliases. | |
virtual void | SetAlias (const char *szName, const char *szAlias, bool bAdd)=0 |
Adds or removes an alias from the list. | |
virtual const char * | GetAlias (const char *szName, bool bReturnSame=true)=0 |
virtual void | Lock ()=0 |
Lock all the operations. | |
virtual void | Unlock ()=0 |
virtual void | LockReadIO (bool bValue)=0 |
Add a lock operation around the read operations to be sure they only happen from one thread. | |
virtual void | SetGameFolder (const char *szFolder)=0 |
Set and Get "Game" folder (/Game, /Game04, ...). | |
virtual const char * | GetGameFolder () const =0 |
virtual void | SetLocalizationFolder (char const *const sLocalizationFolder)=0 |
Set and Get the localization folder name (Languages, Localization, ...). | |
virtual char const *const | GetLocalizationFolder () const =0 |
virtual void | GetCachedPakCDROffsetSize (const char *szName, uint32 &offset, uint32 &size)=0 |
Only returns useful results on a dedicated server at present - and only if the pak is already opened. | |
virtual ICryPak::PakInfo * | GetPakInfo ()=0 |
virtual void | FreePakInfo (PakInfo *)=0 |
virtual FILE * | FOpen (const char *pName, const char *mode, unsigned nFlags=0)=0 |
virtual FILE * | FOpen (const char *pName, const char *mode, char *szFileGamePath, int nLen)=0 |
virtual FILE * | FOpenRaw (const char *pName, const char *mode)=0 |
Just a wrapper for fopen function. For loading sampler unification. | |
virtual size_t | FReadRaw (void *data, size_t length, size_t elems, FILE *handle)=0 |
Read raw data from file, no endian conversion. | |
virtual size_t | FReadRawAll (void *data, size_t nFileSize, FILE *handle)=0 |
virtual void * | FGetCachedFileData (FILE *handle, size_t &nFileSize)=0 |
virtual size_t | FWrite (const void *data, size_t length, size_t elems, FILE *handle)=0 |
virtual int | FPrintf (FILE *handle, const char *format,...) PRINTF_PARAMS(3 |
virtual int FScanf(FILE *, const char *, ...) SCANF_PARAMS(2, 3) =0; | |
virtual int virtual char * | FGets (char *, int, FILE *)=0 |
virtual int | Getc (FILE *)=0 |
virtual size_t | FGetSize (FILE *f)=0 |
virtual size_t | FGetSize (const char *pName, bool bAllowUseFileSystem=false)=0 |
virtual int | Ungetc (int c, FILE *)=0 |
virtual bool | IsInPak (FILE *handle)=0 |
virtual bool | RemoveFile (const char *pName)=0 |
Remove file from FS (if supported). | |
virtual bool | RemoveDir (const char *pName, bool bRecurse)=0 |
Remove directory from FS (if supported). | |
virtual bool | IsAbsPath (const char *pPath)=0 |
Determines if pPath is an absolute or relative path. | |
virtual bool | CopyFileOnDisk (const char *source, const char *dest, bool bFailIfExist)=0 |
virtual size_t | FSeek (FILE *handle, long seek, int mode)=0 |
virtual long | FTell (FILE *handle)=0 |
virtual int | FClose (FILE *handle)=0 |
virtual int | FEof (FILE *handle)=0 |
virtual int | FError (FILE *handle)=0 |
virtual int | FGetErrno ()=0 |
virtual int | FFlush (FILE *handle)=0 |
virtual void * | PoolMalloc (size_t size)=0 |
Return pointer to pool if available. | |
virtual void | PoolFree (void *p)=0 |
Free pool. | |
virtual IMemoryBlock * | PoolAllocMemoryBlock (size_t nSize, const char *sUsage, size_t nAlign=1)=0 |
virtual intptr_t | FindFirst (const char *pDir, _finddata_t *fd, unsigned int nFlags=0, bool bAllOwUseFileSystem=false)=0 |
virtual int | FindNext (intptr_t handle, _finddata_t *fd)=0 |
virtual int | FindClose (intptr_t handle)=0 |
virtual ICryPak::FileTime | GetModificationTime (FILE *f)=0 |
virtual bool | IsFileExist (const char *sFilename, EFileSearchLocation=eFileLocation_Any)=0 |
virtual bool | IsFolder (const char *sPath)=0 |
virtual ICryPak::SignedFileSize | GetFileSizeOnDisk (const char *filename)=0 |
virtual bool | IsFileCompressed (const char *filename)=0 |
virtual bool | MakeDir (const char *szPath, bool bGamePathMapping=false)=0 |
Creates a directory. | |
virtual ICryArchive * | OpenArchive (const char *szPath, unsigned int nFlags=0, IMemoryBlock *pData=0)=0 |
virtual const char * | GetFileArchivePath (FILE *f)=0 |
virtual int | RawCompress (const void *pUncompressed, unsigned long *pDestSize, void *pCompressed, unsigned long nSrcSize, int nLevel=-1)=0 |
virtual int | RawUncompress (void *pUncompressed, unsigned long *pDestSize, const void *pCompressed, unsigned long nSrcSize)=0 |
virtual void | RecordFileOpen (const ERecordFileOpenList eList)=0 |
Turn on/off recording of filenames of opened files. | |
virtual void | RecordFile (FILE *in, const char *szFilename)=0 |
virtual IResourceList * | GetResourceList (const ERecordFileOpenList eList)=0 |
Get resource list of all recorded files, the next level, ... | |
virtual void | SetResourceList (const ERecordFileOpenList eList, IResourceList *pResourceList)=0 |
virtual ICryPak::ERecordFileOpenList | GetRecordFileOpenList ()=0 |
Get the current mode, can be set by RecordFileOpen(). | |
virtual uint32 | ComputeCRC (const char *szPath, uint32 nFileOpenFlags=0)=0 |
virtual bool | ComputeMD5 (const char *szPath, unsigned char *md5, uint32 nFileOpenFlags=0)=0 |
virtual int | ComputeCachedPakCDR_CRC (const char *filename, bool useCryFile=true, IMemoryBlock *pData=NULL)=0 |
virtual void | RegisterFileAccessSink (ICryPakFileAcesssSink *pSink)=0 |
virtual void | UnregisterFileAccessSink (ICryPakFileAcesssSink *pSink)=0 |
virtual bool | GetLvlResStatus () const =0 |
virtual void | DisableRuntimeFileAccess (bool status)=0 |
virtual bool | DisableRuntimeFileAccess (bool status, threadID threadId)=0 |
virtual bool | CheckFileAccessDisabled (const char *name, const char *mode)=0 |
virtual void | SetRenderThreadId (threadID renderThreadId)=0 |
virtual int | GetPakPriority ()=0 |
Gets the current pak priority. | |
virtual uint64 | GetFileOffsetOnMedia (const char *szName)=0 |
virtual EStreamSourceMediaType | GetFileMediaType (const char *szName)=0 |
Return media type for the file. | |
virtual void | CreatePerfHUDWidget ()=0 |
PerfHUD widget for tracking pak file stats. | |
virtual bool | ForEachArchiveFolderEntry (const char *szArchivePath, const char *szFolderPath, const ArchiveEntrySinkFunction &callback)=0 |
template | |
size_t | FRead (T *data, size_t elems, FILE *handle, bool bSwapEndian=eLittleEndian) |
Type-safe endian conversion read. | |
template | |
void | FWrite (T *data, size_t elems, FILE *handle) |
Type-independent Write. | |
Interface to the Pak file system.
enum ICryPak::EFOpenFlags |
Used for widening FOpen functionality. They're ignored for the regular File System files.
Flags used in file path resolution rules.
|
pure virtual |
Given the source relative path, constructs the full path to the file according to the flags.
|
pure virtual |
Computes CRC (zip compatible) for a file. Useful if a huge uncompressed file is generation in non continuous way. Good for big files - low memory overhead (1MB).
szPath | Must not be 0. |
|
pure virtual |
Computes MD5 checksum for a file. Good for big files - low memory overhead (1MB).
szPath | - must not be 0. |
md5 | - destination array of unsigned char [16]. |
|
pure virtual |
Get pointer to the internally cached, loaded data of the file.
|
pure virtual |
nFlags | A combination of EPathResolutionRules flags. |
|
pure virtual |
|
pure virtual |
Open file handle, file can be on disk or in PAK file. Possible mode is r,b,x. Example: FILE *f = FOpen( "test.txt","rbx" );. Mode x is a direct access mode, when used file reads will go directly into the low level file system without any internal data caching. Text mode is not supported for files in PAKs.
|
pure virtual |
Calls a callback for all entries in an archive folder
szFolderPath | contains search masks, if szFolderPath is just a filename or folderpath the callback will be called once for this entry. |
|
pure virtual |
Read all file contents into the provided memory, nSizeOfFile must be the same as returned by GetFileSize(handle). Current seek pointer is ignored and reseted to 0. No endian conversion.
|
pure virtual |
Write file data, cannot be used for writing into the PAK. Use ICryArchive interface for writing into the pak files.
|
pure virtual |
Gets an alias from the list, if any exist. If bReturnSame==true, it will return the input name if an alias doesn't exist. Otherwise returns NULL.
|
pure virtual |
Returns the path to the archive in which the file was opened.
|
pure virtual |
|
pure virtual |
LvlRes can be enabled by command line - then asset resource recording is enabled and some modules can do more asset tracking work based on that.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Open the physical archive file - creates if it doesn't exist. nFlags is a combination of flags from EPakFlags enum.
|
pure virtual |
After this call, the pak file will be searched for files when they aren't on the OS file system.
pName | Must not be 0. |
|
pure virtual |
sUsage | indicates for what usage this memory was requested. |
|
pure virtual |
Compresses the raw data into raw data. The buffer for compressed data itself with the heap passed. Uses method 8 (deflate).
|
pure virtual |
Uncompresses raw (without wrapping) data that is compressed with method 8 (deflated) in the Zip file. This function just mimics the standard uncompress (with modification taken from unzReadCurrentFile) with 2 differences: there are no 16-bit checks, and it initializes the inflation to start without waiting for compression method byte, as this is the way it's stored into zip file.
|
pure virtual |
Record this file if recording is enabled.
in | - 0 if asyncronous read. |
|
pure virtual |
Useful for gathering file access statistics, assert if it was inserted already but then it does not become insersted.
pSink | Must not be 0. |
|
pure virtual |
This marks as Accessible all paks required for specific level and vice versa for all other paks. This is useful in case the game has per level split assets.
|
pure virtual |
Assert if it was not registered already.
pSink | Must not be 0. |