Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
IFileManager Class Referenceabstract

#include <FileManager.h>

+ Inheritance diagram for IFileManager:

Public Member Functions

virtual void ProcessCommandLineOptions ()=0
 
virtual void SetSandboxEnabled (bool bInEnabled)=0
 
virtual bool IsSandboxEnabled () const =0
 
virtual FArchiveCreateFileReader (const TCHAR *Filename, uint32 ReadFlags=0)=0
 
virtual FArchiveCreateFileWriter (const TCHAR *Filename, uint32 WriteFlags=0)=0
 
virtual bool IsReadOnly (const TCHAR *Filename)=0
 
virtual bool Delete (const TCHAR *Filename, bool RequireExists=0, bool EvenReadOnly=0, bool Quiet=0)=0
 
virtual uint32 Copy (const TCHAR *Dest, const TCHAR *Src, bool Replace=1, bool EvenIfReadOnly=0, bool Attributes=0, FCopyProgress *Progress=nullptr, EFileRead ReadFlags=FILEREAD_None, EFileWrite WriteFlags=FILEWRITE_None)=0
 
virtual bool Move (const TCHAR *Dest, const TCHAR *Src, bool Replace=1, bool EvenIfReadOnly=0, bool Attributes=0, bool bDoNotRetryOrError=0)=0
 
virtual bool FileExists (const TCHAR *Filename)=0
 
virtual bool DirectoryExists (const TCHAR *InDirectory)=0
 
virtual bool MakeDirectory (const TCHAR *Path, bool Tree=0)=0
 
virtual bool DeleteDirectory (const TCHAR *Path, bool RequireExists=0, bool Tree=0)=0
 
virtual FFileStatData GetStatData (const TCHAR *FilenameOrDirectory)=0
 
virtual void FindFiles (TArray< FString > &FileNames, const TCHAR *Filename, bool Files, bool Directories)=0
 
virtual void FindFiles (TArray< FString > &FoundFiles, const TCHAR *Directory, const TCHAR *FileExtension=nullptr)=0
 
virtual void FindFilesRecursive (TArray< FString > &FileNames, const TCHAR *StartDirectory, const TCHAR *Filename, bool Files, bool Directories, bool bClearFileNames=true)=0
 
virtual bool IterateDirectory (const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor)=0
 
virtual bool IterateDirectory (const TCHAR *Directory, IPlatformFile::FDirectoryVisitorFunc Visitor)=0
 
virtual bool IterateDirectoryRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryVisitor &Visitor)=0
 
virtual bool IterateDirectoryRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryVisitorFunc Visitor)=0
 
virtual bool IterateDirectoryStat (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor)=0
 
virtual bool IterateDirectoryStat (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitorFunc Visitor)=0
 
virtual bool IterateDirectoryStatRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitor &Visitor)=0
 
virtual bool IterateDirectoryStatRecursively (const TCHAR *Directory, IPlatformFile::FDirectoryStatVisitorFunc Visitor)=0
 
virtual double GetFileAgeSeconds (const TCHAR *Filename)=0
 
virtual FDateTime GetTimeStamp (const TCHAR *Path)=0
 
virtual void GetTimeStampPair (const TCHAR *PathA, const TCHAR *PathB, FDateTime &OutTimeStampA, FDateTime &OutTimeStampB)=0
 
virtual bool SetTimeStamp (const TCHAR *Path, FDateTime TimeStamp)=0
 
virtual FDateTime GetAccessTimeStamp (const TCHAR *Filename)=0
 
virtual FString ConvertToRelativePath (const TCHAR *Filename)=0
 
virtual FString ConvertToAbsolutePathForExternalAppForRead (const TCHAR *Filename)=0
 
virtual FString ConvertToAbsolutePathForExternalAppForWrite (const TCHAR *Filename)=0
 
virtual int64 FileSize (const TCHAR *Filename)=0
 
virtual bool SendMessageToServer (const TCHAR *Message, IPlatformFile::IFileServerMessageHandler *Handler)=0
 
virtual FString GetFilenameOnDisk (const TCHAR *Filename)=0
 

Static Public Member Functions

static IFileManagerGet ()
 

Protected Member Functions

 IFileManager ()
 

Detailed Description

Definition at line 57 of file FileManager.h.

Constructor & Destructor Documentation

◆ IFileManager()

IFileManager::IFileManager ( )
inlineprotected

Construtor.

Definition at line 62 of file FileManager.h.

Member Function Documentation

◆ ConvertToAbsolutePathForExternalAppForRead()

virtual FString IFileManager::ConvertToAbsolutePathForExternalAppForRead ( const TCHAR * Filename)
pure virtual

Converts passed in filename to use an absolute path (for reading)

Parameters
Filenamefilename to convert to use an absolute path, safe to pass in already using absolute path
Returns
filename using absolute path

Implemented in FFileManagerGeneric.

◆ ConvertToAbsolutePathForExternalAppForWrite()

virtual FString IFileManager::ConvertToAbsolutePathForExternalAppForWrite ( const TCHAR * Filename)
pure virtual

Converts passed in filename to use an absolute path (for writing)

Parameters
Filenamefilename to convert to use an absolute path, safe to pass in already using absolute path
Returns
filename using absolute path

Implemented in FFileManagerGeneric.

◆ ConvertToRelativePath()

virtual FString IFileManager::ConvertToRelativePath ( const TCHAR * Filename)
pure virtual

Converts passed in filename to use a relative path.

Parameters
Filenamefilename to convert to use a relative path
Returns
filename using relative path

Implemented in FFileManagerGeneric.

◆ Copy()

virtual uint32 IFileManager::Copy ( const TCHAR * Dest,
const TCHAR * Src,
bool Replace = 1,
bool EvenIfReadOnly = 0,
bool Attributes = 0,
FCopyProgress * Progress = nullptr,
EFileRead ReadFlags = FILEREAD_None,
EFileWrite WriteFlags = FILEWRITE_None )
pure virtual

Copies a file.

Implemented in FFileManagerGeneric.

◆ CreateFileReader()

virtual FArchive * IFileManager::CreateFileReader ( const TCHAR * Filename,
uint32 ReadFlags = 0 )
pure virtual

Opens a file for reading and create an FArchive which can be used to read from it.

Parameters
FilenamePath to the file to open
ReadFlagsAn optional bitfield of optional flags. For flag values see @See EFileRead
Returns
Returns a pointer to an FArchive when successful and a nullptr if the operation failed. Note that it is up to the caller to delete the FArchive when done.

Implemented in FFileManagerGeneric.

+ Here is the caller graph for this function:

◆ CreateFileWriter()

virtual FArchive * IFileManager::CreateFileWriter ( const TCHAR * Filename,
uint32 WriteFlags = 0 )
pure virtual

Opens a file for writing and create an FArchive which can be used to write to it.

Parameters
FilenamePath to the desired location of the file
WriteFlagsAn optional bitfield of optional flags. For flag values see @See EFileWrite
Returns
Returns a pointer to an FArchive when successful and a nullptr if the operation failed. Note that it is up to the caller to delete the FArchive when done.

Implemented in FFileManagerGeneric.

◆ Delete()

virtual bool IFileManager::Delete ( const TCHAR * Filename,
bool RequireExists = 0,
bool EvenReadOnly = 0,
bool Quiet = 0 )
pure virtual

Deletes a file.

Implemented in FFileManagerGeneric.

◆ DeleteDirectory()

virtual bool IFileManager::DeleteDirectory ( const TCHAR * Path,
bool RequireExists = 0,
bool Tree = 0 )
pure virtual

Deletes a directory.

Implemented in FFileManagerGeneric.

◆ DirectoryExists()

virtual bool IFileManager::DirectoryExists ( const TCHAR * InDirectory)
pure virtual

Checks if a directory exists.

Implemented in FFileManagerGeneric.

◆ FileExists()

virtual bool IFileManager::FileExists ( const TCHAR * Filename)
pure virtual

Checks if a file exists

Implemented in FFileManagerGeneric.

◆ FileSize()

virtual int64 IFileManager::FileSize ( const TCHAR * Filename)
pure virtual

Returns the size of a file. (Thread-safe)

Parameters
FilenamePlatform-independent Unreal filename.
Returns
File size in bytes or INDEX_NONE if the file didn't exist.

Implemented in FFileManagerGeneric.

◆ FindFiles() [1/2]

virtual void IFileManager::FindFiles ( TArray< FString > & FileNames,
const TCHAR * Filename,
bool Files,
bool Directories )
pure virtual

Finds file or directories.

Implemented in FFileManagerGeneric.

◆ FindFiles() [2/2]

virtual void IFileManager::FindFiles ( TArray< FString > & FoundFiles,
const TCHAR * Directory,
const TCHAR * FileExtension = nullptr )
pure virtual

Finds all the files within the given directory, with optional file extension filter.

Parameters
[out]FoundFilesAll the files that matched the optional FileExtension filter, or all files if none was specified.
[in]DirectoryThe absolute path to the directory to search. Ex: "C:\UE4\Pictures"
[in]FileExtensionIf FileExtension is NULL, or an empty string "" then all files are found. Otherwise FileExtension can be of the form .EXT or just EXT and only files with that extension will be returned.

Implemented in FFileManagerGeneric.

◆ FindFilesRecursive()

virtual void IFileManager::FindFilesRecursive ( TArray< FString > & FileNames,
const TCHAR * StartDirectory,
const TCHAR * Filename,
bool Files,
bool Directories,
bool bClearFileNames = true )
pure virtual

Finds file or directories recursively.

Implemented in FFileManagerGeneric.

◆ Get()

static IFileManager & IFileManager::Get ( )
static

Singleton access, platform specific, also calls PreInit()

+ Here is the caller graph for this function:

◆ GetAccessTimeStamp()

virtual FDateTime IFileManager::GetAccessTimeStamp ( const TCHAR * Filename)
pure virtual
Returns
the last access time of the given file (or FDateTime::MinValue() on failure)

Implemented in FFileManagerGeneric.

◆ GetFileAgeSeconds()

virtual double IFileManager::GetFileAgeSeconds ( const TCHAR * Filename)
pure virtual

Gets the age of a file measured in seconds.

Implemented in FFileManagerGeneric.

◆ GetFilenameOnDisk()

virtual FString IFileManager::GetFilenameOnDisk ( const TCHAR * Filename)
pure virtual

For case insensitive filesystems, returns the full path of the file with the same case as in the filesystem.

Parameters
FilenameFilename to query
Returns
Filename with the same case as in the filesystem.

Implemented in FFileManagerGeneric.

◆ GetStatData()

virtual FFileStatData IFileManager::GetStatData ( const TCHAR * FilenameOrDirectory)
pure virtual

Return the stat data for the given file or directory. Check the FFileStatData::bIsValid member before using the returned data

Implemented in FFileManagerGeneric.

◆ GetTimeStamp()

virtual FDateTime IFileManager::GetTimeStamp ( const TCHAR * Path)
pure virtual
Returns
the modification time of the given file (or FDateTime::MinValue() on failure)

Implemented in FFileManagerGeneric.

◆ GetTimeStampPair()

virtual void IFileManager::GetTimeStampPair ( const TCHAR * PathA,
const TCHAR * PathB,
FDateTime & OutTimeStampA,
FDateTime & OutTimeStampB )
pure virtual
Parameters
[in]PathAThe first given file
[in]PathBThe second given file
[out]OutTimeStampAthe modification time of the first given file (or FDateTime::MinValue() on failure)
[out]OutTimeStampBthe modification time of the second given file (or FDateTime::MinValue() on failure)

Implemented in FFileManagerGeneric.

◆ IsReadOnly()

virtual bool IFileManager::IsReadOnly ( const TCHAR * Filename)
pure virtual

Checks if a file is read-only.

Implemented in FFileManagerGeneric.

◆ IsSandboxEnabled()

virtual bool IFileManager::IsSandboxEnabled ( ) const
pure virtual

Returns whether the sandbox is enabled or not

Implemented in FFileManagerGeneric.

◆ IterateDirectory() [1/2]

virtual bool IFileManager::IterateDirectory ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitor & Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectory() [2/2]

virtual bool IFileManager::IterateDirectory ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitorFunc Visitor )
pure virtual

Call the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory (see FDirectoryVisitor::Visit for the signature)
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryRecursively() [1/2]

virtual bool IFileManager::IterateDirectoryRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitor & Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryRecursively() [2/2]

virtual bool IFileManager::IterateDirectoryRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitorFunc Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories (see FDirectoryVisitor::Visit for the signature).
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryStat() [1/2]

virtual bool IFileManager::IterateDirectoryStat ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitor & Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryStat() [2/2]

virtual bool IFileManager::IterateDirectoryStat ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitorFunc Visitor )
pure virtual

Call the visitor once for each file or directory in a single directory. This function does not explore subdirectories.

Parameters
DirectoryThe directory to iterate the contents of.
VisitorVisitor to call for each element of the directory (see FDirectoryStatVisitor::Visit for the signature)
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryStatRecursively() [1/2]

virtual bool IFileManager::IterateDirectoryStatRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitor & Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories.
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ IterateDirectoryStatRecursively() [2/2]

virtual bool IFileManager::IterateDirectoryStatRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitorFunc Visitor )
pure virtual

Call the Visit function of the visitor once for each file or directory in a directory tree. This function explores subdirectories.

Parameters
DirectoryThe directory to iterate the contents of, recursively.
VisitorVisitor to call for each element of the directory and each element of all subdirectories (see FDirectoryStatVisitor::Visit for the signature).
Returns
false if the directory did not exist or if the visitor returned false.

Implemented in FFileManagerGeneric.

◆ MakeDirectory()

virtual bool IFileManager::MakeDirectory ( const TCHAR * Path,
bool Tree = 0 )
pure virtual

Creates a directory.

Implemented in FFileManagerGeneric.

◆ Move()

virtual bool IFileManager::Move ( const TCHAR * Dest,
const TCHAR * Src,
bool Replace = 1,
bool EvenIfReadOnly = 0,
bool Attributes = 0,
bool bDoNotRetryOrError = 0 )
pure virtual

Moves/renames a file.

Implemented in FFileManagerGeneric.

◆ ProcessCommandLineOptions()

virtual void IFileManager::ProcessCommandLineOptions ( )
pure virtual

Allow the file manager to handle the commandline

Implemented in FFileManagerGeneric.

◆ SendMessageToServer()

virtual bool IFileManager::SendMessageToServer ( const TCHAR * Message,
IPlatformFile::IFileServerMessageHandler * Handler )
pure virtual

Sends a message to the file server, and will block until it's complete. Will return immediately if the file manager doesn't support talking to a server.

Parameters
MessageThe string message to send to the server
Returns
true if the message was sent to server and it returned success, or false if there is no server, or the command failed

Implemented in FFileManagerGeneric.

◆ SetSandboxEnabled()

virtual void IFileManager::SetSandboxEnabled ( bool bInEnabled)
pure virtual

Enables/disables the sandbox, if it is being used

Implemented in FFileManagerGeneric.

◆ SetTimeStamp()

virtual bool IFileManager::SetTimeStamp ( const TCHAR * Path,
FDateTime TimeStamp )
pure virtual

Sets the modification time of the given file

Implemented in FFileManagerGeneric.


The documentation for this class was generated from the following file: