Description | Hierarchy | Fields | Methods | Properties |
type TFileSystem = class(TReferenceCounted)
Manages files and archives and provides access to them.
It manages where files are, so that modules which use the the IO do not need to know where every file is located. A file could be in a .zip-Archive or as file on disk, using the TFileSystem
makes no difference to this.
![]() |
function AddFileArchive(const FileName: StringType; IgnoreCase: Boolean = True; IgnorePaths: Boolean = True; ArchiveType: TFileArchiveType = faUnknown; const Password: AnsiString = ''): Boolean; inline; |
![]() |
function ChangeWorkingDirectoryTo(const NewDirecotry: StringType): Boolean; inline; |
![]() |
function CreateAndOpenFile(const FileName: StringType): TReadFile; inline; |
![]() |
function CreateAndWriteFile(const FileName: StringType; Append: Boolean = False): TWriteFile; inline; |
![]() |
function CreateEmptyAttributes(Driver: TVideoDriver = nil): TAttributes; inline; |
![]() |
function CreateEmptyFileList(const Path: StringType; IgnoreCase, IgnorePaths: Boolean): TFileList; inline; |
![]() |
function CreateFileList: TFileList; inline; |
![]() |
function CreateLimitReadFile(const FileName: StringType; AlreadyOpenedFile: TReadFile; Pos, AreaSize: LongType): TReadFile; inline; |
![]() |
function CreateMemoryReadFile(Memory: Pointer; Bytes: LongInt; const FileName: StringType; DeleteMemoryWhenDropped: Boolean = False): TReadFile; inline; |
![]() |
function CreateMemoryWriteFile(Memory: Pointer; Bytes: LongInt; const FileName: StringType; DeleteMemoryWhenDropped: Boolean = False): TWriteFile; inline; |
![]() |
function CreateXMLReader(const FileName: StringType): TXMLReader; overload; inline; |
![]() |
function CreateXMLReader(RFile: TReadFile): TXMLReader; overload; inline; |
![]() |
function CreateXMLWriter(const FileName: StringType): TXMLWriter; overload; inline; |
![]() |
function CreateXMLWriter(WFile: TWriteFile): TXMLWriter; overload; inline; |
![]() |
function FileExists(const Path: StringType): Boolean; inline; |
![]() |
function FlattenFileName(const FileName: StringType; const Root: StringType='/'): StringType; inline; |
![]() |
function GetAbsolutePath(const FileName: StringType): StringType; inline; |
![]() |
function GetFileArchive(Index: LongWord): TFileArchive; inline; |
![]() |
function GetFileBaseName(const FileName: StringType; KeepExtension: Boolean = True): StringType; inline; |
![]() |
function GetFileDir(const FileName: StringType): StringType; inline; |
![]() |
function MoveFileArchive(Index: LongWord; Relative: LongInt): Boolean; inline; |
![]() |
function RemoveFileArchive(Index: LongWord): Boolean; overload; inline; |
![]() |
function RemoveFileArchive(const FileName: StringType): Boolean; overload; inline; |
![]() |
function SetFileListSystem(ListType: TFileSystemType): TFileSystemType; inline; |
![]() |
procedure AddArchiveLoader(Loader: TArchiveLoader); inline; |
![]() |
property FileArchiveCount: LongWord read GetFileArchiveCount; |
![]() |
property WorkingDirectory: StringType read GetWorkingDirectory; |
![]() |
function AddFileArchive(const FileName: StringType; IgnoreCase: Boolean = True; IgnorePaths: Boolean = True; ArchiveType: TFileArchiveType = faUnknown; const Password: AnsiString = ''): Boolean; inline; |
Adds an archive to the file system. Parameters
ReturnsTrue if the archive was added successfully, false if not. |
![]() |
function ChangeWorkingDirectoryTo(const NewDirecotry: StringType): Boolean; inline; |
Changes the current working directory. Parameters
ReturnsTrue if successful, otherwise false. |
![]() |
function CreateAndOpenFile(const FileName: StringType): TReadFile; inline; |
Opens a file for read access. Parameters
ReturnsThe created file interface. The returned pointer should be dropped when no longer needed. See TReferenceCounted.Drop for more information. |
![]() |
function CreateAndWriteFile(const FileName: StringType; Append: Boolean = False): TWriteFile; inline; |
Opens a file for write access. Parameters
ReturnsThe created file interface. The returned pointer should be dropped when no longer needed. See TReferenceCounted.Drop for more information. |
![]() |
function CreateEmptyAttributes(Driver: TVideoDriver = nil): TAttributes; inline; |
Creates a new empty collection of attributes, usable for serialization and more. Parameters
ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateEmptyFileList(const Path: StringType; IgnoreCase, IgnorePaths: Boolean): TFileList; inline; |
Creates a new empty collection of attributes, usable for serialization and more. Parameters
ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateFileList: TFileList; inline; |
Creates an empty file list. ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateLimitReadFile(const FileName: StringType; AlreadyOpenedFile: TReadFile; Pos, AreaSize: LongType): TReadFile; inline; |
Creates a TReadFile interface for accessing files inside files. Parameters
ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateMemoryReadFile(Memory: Pointer; Bytes: LongInt; const FileName: StringType; DeleteMemoryWhenDropped: Boolean = False): TReadFile; inline; |
Creates a TReadFile interface for accessing memory like a file. Parameters
ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateMemoryWriteFile(Memory: Pointer; Bytes: LongInt; const FileName: StringType; DeleteMemoryWhenDropped: Boolean = False): TWriteFile; inline; |
Creates a TWriteFile interface for accessing memory like a file. Parameters
ReturnsThe created object. Should be dropped when no longer needed, see TReferenceCounted.Drop for more information. |
![]() |
function CreateXMLReader(const FileName: StringType): TXMLReader; overload; inline; |
Creates a XML reader by file name. Returnsnil, if file could not be opened, otherwise a pointer to the created TXMLReader is returned. After use, the reader has to be deleted using its TXMLReader.Drop method. See TReferenceCounted,Drop for more information. |
![]() |
function CreateXMLReader(RFile: TReadFile): TXMLReader; overload; inline; |
Creates a XML reader from an open TReadFile. Returnsnil, if file could not be opened, otherwise a pointer to the created TXMLReader is returned. After use, the reader has to be deleted using its TXMLReader.Drop method. See TReferenceCounted,Drop for more information. |
![]() |
function CreateXMLWriter(const FileName: StringType): TXMLWriter; overload; inline; |
Creates a XML writer writing to a newly opened file. Returnsnil, if file could not be opened, otherwise a pointer to the created TXMLReader is returned. After use, the reader has to be deleted using its TXMLReader.Drop method. See TReferenceCounted,Drop for more information. |
![]() |
function CreateXMLWriter(WFile: TWriteFile): TXMLWriter; overload; inline; |
Creates a XML writer on an open TWriteFile. Returnsnil, if file could not be opened, otherwise a pointer to the created TXMLReader is returned. After use, the reader has to be deleted using its TXMLReader.Drop method. See TReferenceCounted,Drop for more information. |
![]() |
function FileExists(const Path: StringType): Boolean; inline; |
Determines if a file exists and could be opened. Parameters
ReturnsTrue if file exists, and false if it does not exist or an error occured. |
![]() |
function FlattenFileName(const FileName: StringType; const Root: StringType='/'): StringType; inline; |
Flattens a path and file name. |
![]() |
function GetAbsolutePath(const FileName: StringType): StringType; inline; |
Converts a relative path to an absolute (unique) path resolving symbolic links if required. Parameters
ReturnsAbsolute filename which points to the same file. |
![]() |
function GetFileArchive(Index: LongWord): TFileArchive; inline; |
Get the archive at a given index. |
![]() |
function GetFileBaseName(const FileName: StringType; KeepExtension: Boolean = True): StringType; inline; |
Get the base part of a filename, i.e. the name without the directory part. Parameters
|
![]() |
function GetFileDir(const FileName: StringType): StringType; inline; |
Get the directory a file is located in. Parameters
ReturnsString containing the directory of the file. |
![]() |
function RemoveFileArchive(const FileName: StringType): Boolean; overload; inline; |
Removes an archive from the file system. Parameters
ReturnsTrue on success, false on failure. |
![]() |
function SetFileListSystem(ListType: TFileSystemType): TFileSystemType; inline; |
Set the active type of file system. |
![]() |
procedure AddArchiveLoader(Loader: TArchiveLoader); inline; |
Adds an external archive loader to the engine. |
![]() |
property FileArchiveCount: LongWord read GetFileArchiveCount; |
The number of archives currently attached to the file system. |
![]() |
property WorkingDirectory: StringType read GetWorkingDirectory; |
The current working directory. |