Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FFileManagerGeneric Class Reference

#include <FileManagerGeneric.h>

+ Inheritance diagram for FFileManagerGeneric:
+ Collaboration diagram for FFileManagerGeneric:

Public Member Functions

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

Static Public Member Functions

static FString DefaultConvertToRelativePath (const TCHAR *Filename)
 
- Static Public Member Functions inherited from IFileManager
static IFileManagerGet ()
 

Private Member Functions

FORCEINLINE IPlatformFileGetLowLevel () const
 
FArchiveCreateFileReaderInternal (const TCHAR *Filename, uint32 ReadFlags, uint32 BufferSize)
 
FArchiveCreateFileWriterInternal (const TCHAR *Filename, uint32 WriteFlags, uint32 BufferSize)
 
uint32 CopyWithProgress (const TCHAR *InDestFile, const TCHAR *InSrcFile, bool ReplaceExisting, bool EvenIfReadOnly, bool Attributes, FCopyProgress *Progress, EFileRead ReadFlags, EFileWrite WriteFlags)
 
void FindFilesRecursiveInternal (TArray< FString > &FileNames, const TCHAR *StartDirectory, const TCHAR *Filename, bool Files, bool Directories)
 

Additional Inherited Members

- Protected Member Functions inherited from IFileManager
 IFileManager ()
 

Detailed Description

Base class for file managers.

This base class simplifies IFileManager implementations by providing simple, unoptimized implementations of functions whose implementations can be derived from other functions.

Definition at line 35 of file FileManagerGeneric.h.

Constructor & Destructor Documentation

◆ FFileManagerGeneric()

FFileManagerGeneric::FFileManagerGeneric ( )
inline

Default constructor.

Definition at line 49 of file FileManagerGeneric.h.

◆ ~FFileManagerGeneric()

virtual FFileManagerGeneric::~FFileManagerGeneric ( )
inlinevirtual

Virtual destructor.

Definition at line 54 of file FileManagerGeneric.h.

Member Function Documentation

◆ ConvertToAbsolutePathForExternalAppForRead()

FString FFileManagerGeneric::ConvertToAbsolutePathForExternalAppForRead ( const TCHAR * Filename)
overridevirtual

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

Implements IFileManager.

◆ ConvertToAbsolutePathForExternalAppForWrite()

FString FFileManagerGeneric::ConvertToAbsolutePathForExternalAppForWrite ( const TCHAR * Filename)
overridevirtual

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

Implements IFileManager.

◆ ConvertToRelativePath()

FString FFileManagerGeneric::ConvertToRelativePath ( const TCHAR * Filename)
overridevirtual

Converts passed in filename to use a relative path.

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

Implements IFileManager.

◆ Copy()

virtual uint32 FFileManagerGeneric::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 )
overridevirtual

Copies a file.

Implements IFileManager.

◆ CopyWithProgress()

uint32 FFileManagerGeneric::CopyWithProgress ( const TCHAR * InDestFile,
const TCHAR * InSrcFile,
bool ReplaceExisting,
bool EvenIfReadOnly,
bool Attributes,
FCopyProgress * Progress,
EFileRead ReadFlags,
EFileWrite WriteFlags )
private

Helper called from Copy if Progress is available

◆ CreateFileReader()

FArchive * FFileManagerGeneric::CreateFileReader ( const TCHAR * Filename,
uint32 ReadFlags = 0 )
inlineoverridevirtual

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.

Implements IFileManager.

Definition at line 72 of file FileManagerGeneric.h.

+ Here is the call graph for this function:

◆ CreateFileReaderInternal()

FArchive * FFileManagerGeneric::CreateFileReaderInternal ( const TCHAR * Filename,
uint32 ReadFlags,
uint32 BufferSize )
private
+ Here is the caller graph for this function:

◆ CreateFileWriter()

FArchive * FFileManagerGeneric::CreateFileWriter ( const TCHAR * Filename,
uint32 WriteFlags = 0 )
inlineoverridevirtual

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.

Implements IFileManager.

Definition at line 77 of file FileManagerGeneric.h.

+ Here is the call graph for this function:

◆ CreateFileWriterInternal()

FArchive * FFileManagerGeneric::CreateFileWriterInternal ( const TCHAR * Filename,
uint32 WriteFlags,
uint32 BufferSize )
private
+ Here is the caller graph for this function:

◆ DefaultConvertToRelativePath()

static FString FFileManagerGeneric::DefaultConvertToRelativePath ( const TCHAR * Filename)
static

Converts passed in filename to use a relative path.

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

◆ Delete()

bool FFileManagerGeneric::Delete ( const TCHAR * Filename,
bool RequireExists = 0,
bool EvenReadOnly = 0,
bool Quiet = 0 )
overridevirtual

Deletes a file.

Implements IFileManager.

◆ DeleteDirectory()

virtual bool FFileManagerGeneric::DeleteDirectory ( const TCHAR * Path,
bool RequireExists = 0,
bool Tree = 0 )
overridevirtual

Deletes a directory.

Implements IFileManager.

◆ DirectoryExists()

bool FFileManagerGeneric::DirectoryExists ( const TCHAR * InDirectory)
overridevirtual

Checks if a directory exists.

Implements IFileManager.

◆ FileExists()

bool FFileManagerGeneric::FileExists ( const TCHAR * Filename)
overridevirtual

Checks if a file exists

Implements IFileManager.

◆ FileSize()

int64 FFileManagerGeneric::FileSize ( const TCHAR * Filename)
overridevirtual

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.

Implements IFileManager.

◆ FindFiles() [1/2]

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

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

Parameters
Directory,theabsolute path to the directory to search. Ex: "C:\UE4\Pictures"
FileExtension,IfFileExtension 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.
Returns
FoundFiles, All the files that matched the optional FileExtension filter, or all files if none was specified.

Implements IFileManager.

◆ FindFiles() [2/2]

void FFileManagerGeneric::FindFiles ( TArray< FString > & FileNames,
const TCHAR * Filename,
bool Files,
bool Directories )
overridevirtual

Finds file or directories.

Implements IFileManager.

◆ FindFilesRecursive()

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

Finds file or directories recursively.

Implements IFileManager.

◆ FindFilesRecursiveInternal()

void FFileManagerGeneric::FindFilesRecursiveInternal ( TArray< FString > & FileNames,
const TCHAR * StartDirectory,
const TCHAR * Filename,
bool Files,
bool Directories )
private

◆ GetAccessTimeStamp()

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

Implements IFileManager.

◆ GetFileAgeSeconds()

double FFileManagerGeneric::GetFileAgeSeconds ( const TCHAR * Filename)
overridevirtual

Gets the age of a file measured in seconds.

Implements IFileManager.

◆ GetFilenameOnDisk()

virtual FString FFileManagerGeneric::GetFilenameOnDisk ( const TCHAR * Filename)
overridevirtual

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.

Implements IFileManager.

◆ GetLowLevel()

FORCEINLINE IPlatformFile & FFileManagerGeneric::GetLowLevel ( ) const
inlineprivate

Definition at line 39 of file FileManagerGeneric.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetStatData()

virtual FFileStatData FFileManagerGeneric::GetStatData ( const TCHAR * FilenameOrDirectory)
overridevirtual

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

Implements IFileManager.

◆ GetTimeStamp()

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

Implements IFileManager.

◆ GetTimeStampPair()

void FFileManagerGeneric::GetTimeStampPair ( const TCHAR * PathA,
const TCHAR * PathB,
FDateTime & OutTimeStampA,
FDateTime & OutTimeStampB )
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)

Implements IFileManager.

◆ IsReadOnly()

bool FFileManagerGeneric::IsReadOnly ( const TCHAR * Filename)
overridevirtual

Checks if a file is read-only.

Implements IFileManager.

◆ IsSandboxEnabled()

virtual bool FFileManagerGeneric::IsSandboxEnabled ( ) const
inlineoverridevirtual

Returns whether the sandbox is enabled or not

Implements IFileManager.

Definition at line 67 of file FileManagerGeneric.h.

+ Here is the call graph for this function:

◆ IterateDirectory() [1/2]

bool FFileManagerGeneric::IterateDirectory ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitor & Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectory() [2/2]

bool FFileManagerGeneric::IterateDirectory ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitorFunc Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryRecursively() [1/2]

bool FFileManagerGeneric::IterateDirectoryRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitor & Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryRecursively() [2/2]

bool FFileManagerGeneric::IterateDirectoryRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryVisitorFunc Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryStat() [1/2]

bool FFileManagerGeneric::IterateDirectoryStat ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitor & Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryStat() [2/2]

bool FFileManagerGeneric::IterateDirectoryStat ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitorFunc Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryStatRecursively() [1/2]

bool FFileManagerGeneric::IterateDirectoryStatRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitor & Visitor )
overridevirtual

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.

Implements IFileManager.

◆ IterateDirectoryStatRecursively() [2/2]

bool FFileManagerGeneric::IterateDirectoryStatRecursively ( const TCHAR * Directory,
IPlatformFile::FDirectoryStatVisitorFunc Visitor )
overridevirtual

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.

Implements IFileManager.

◆ MakeDirectory()

virtual bool FFileManagerGeneric::MakeDirectory ( const TCHAR * Path,
bool Tree = 0 )
overridevirtual

Creates a directory.

Implements IFileManager.

◆ Move()

bool FFileManagerGeneric::Move ( const TCHAR * Dest,
const TCHAR * Src,
bool Replace = 1,
bool EvenIfReadOnly = 0,
bool Attributes = 0,
bool bDoNotRetryOrError = 0 )
overridevirtual

Moves/renames a file.

Implements IFileManager.

◆ ProcessCommandLineOptions()

virtual void FFileManagerGeneric::ProcessCommandLineOptions ( )
overridevirtual

Allow the file manager to handle the commandline

Implements IFileManager.

◆ SendMessageToServer()

virtual bool FFileManagerGeneric::SendMessageToServer ( const TCHAR * Message,
IPlatformFile::IFileServerMessageHandler * Handler )
inlineoverridevirtual

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

Implements IFileManager.

Definition at line 204 of file FileManagerGeneric.h.

+ Here is the call graph for this function:

◆ SetSandboxEnabled()

virtual void FFileManagerGeneric::SetSandboxEnabled ( bool bInEnabled)
inlineoverridevirtual

Enables/disables the sandbox, if it is being used

Implements IFileManager.

Definition at line 62 of file FileManagerGeneric.h.

+ Here is the call graph for this function:

◆ SetTimeStamp()

bool FFileManagerGeneric::SetTimeStamp ( const TCHAR * Path,
FDateTime TimeStamp )
overridevirtual

Sets the modification time of the given file

Implements IFileManager.


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