Loading...
Searching...
No Matches
IFileSystem.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_FILE_SYSTEM_H_INCLUDED__
#define __I_FILE_SYSTEM_H_INCLUDED__
#include "IReferenceCounted.h"
#include "IXMLReader.h"
#include "IFileArchive.h"
namespace irr
{
namespace video
{
class IVideoDriver;
} // end namespace video
namespace io
{
class IReadFile;
class IWriteFile;
class IFileList;
class IXMLWriter;
class IAttributes;
class IFileSystem : public virtual IReferenceCounted
{
public:
virtual IReadFile* createAndOpenFile(const path& filename) =0;
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
virtual IReadFile* createLimitReadFile(const path& fileName,
IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
virtual bool addFileArchive(const path& filename, bool ignoreCase=true,
bool ignorePaths=true,
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
const core::stringc& password="",
IFileArchive** retArchive=0) =0;
virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true,
bool ignorePaths=true,
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
const core::stringc& password="",
IFileArchive** retArchive=0) =0;
virtual bool addFileArchive(IFileArchive* archive) =0;
virtual u32 getFileArchiveCount() const =0;
virtual bool removeFileArchive(u32 index) =0;
virtual bool removeFileArchive(const path& filename) =0;
virtual bool removeFileArchive(const IFileArchive* archive) =0;
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
virtual IFileArchive* getFileArchive(u32 index) =0;
virtual void addArchiveLoader(IArchiveLoader* loader) =0;
virtual u32 getArchiveLoaderCount() const = 0;
virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0;
_IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
{
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
}
_IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
{
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
}
_IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
{
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
}
virtual const path& getWorkingDirectory() =0;
virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
virtual path getAbsolutePath(const path& filename) const =0;
virtual path getFileDir(const path& filename) const =0;
virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
virtual path& flattenFilename(path& directory, const path& root="/") const =0;
virtual path getRelativeFilename(const path& filename, const path& directory) const =0;
virtual IFileList* createFileList() =0;
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
virtual bool existFile(const path& filename) const =0;
virtual IXMLReader* createXMLReader(const path& filename) =0;
virtual IXMLReader* createXMLReader(IReadFile* file) =0;
virtual IXMLReaderUTF8* createXMLReaderUTF8(const path& filename) =0;
virtual IXMLReaderUTF8* createXMLReaderUTF8(IReadFile* file) =0;
virtual IXMLWriter* createXMLWriter(const path& filename) =0;
virtual IXMLWriter* createXMLWriter(IWriteFile* file) =0;
virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) =0;
};
} // end namespace io
} // end namespace irr
#endif
IFileArchive.h
IReferenceCounted.h
IXMLReader.h
irr::IReferenceCounted::IReferenceCounted
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:46
irr::io::IArchiveLoader
Class which is able to create an archive from a file.
Definition IFileArchive.h:92
irr::io::IAttributes
Provides a generic interface for attributes and their values and the possiblity to serialize them.
Definition IAttributes.h:42
irr::io::IFileArchive
The FileArchive manages archives and provides access to files inside them.
Definition IFileArchive.h:54
irr::io::IFileList
Provides a list of files and folders.
Definition IFileList.h:20
irr::io::IFileSystem
The FileSystem manages files and archives and provides access to them.
Definition IFileSystem.h:33
irr::io::IFileSystem::removeFileArchive
virtual bool removeFileArchive(const path &filename)=0
Removes an archive from the file system.
irr::io::IFileSystem::existFile
virtual bool existFile(const path &filename) const =0
Determines if a file exists and could be opened.
irr::io::IFileSystem::createXMLReader
virtual IXMLReader * createXMLReader(const path &filename)=0
Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
irr::io::IFileSystem::getFileBasename
virtual path getFileBasename(const path &filename, bool keepExtension=true) const =0
Get the base part of a filename, i.e. the name without the directory part.
irr::io::IFileSystem::createAndWriteFile
virtual IWriteFile * createAndWriteFile(const path &filename, bool append=false)=0
Opens a file for write access.
irr::io::IFileSystem::createMemoryWriteFile
virtual IWriteFile * createMemoryWriteFile(void *memory, s32 len, const path &fileName, bool deleteMemoryWhenDropped=false)=0
Creates an IWriteFile interface for accessing memory like a file.
irr::io::IFileSystem::createEmptyAttributes
virtual IAttributes * createEmptyAttributes(video::IVideoDriver *driver=0)=0
Creates a new empty collection of attributes, usable for serialization and more.
irr::io::IFileSystem::addPakFileArchive
virtual _IRR_DEPRECATED_ bool addPakFileArchive(const c8 *filename, bool ignoreCase=true, bool ignorePaths=true)
Adds a pak archive to the file system.
Definition IFileSystem.h:262
irr::io::IFileSystem::createXMLReader
virtual IXMLReader * createXMLReader(IReadFile *file)=0
Creates a XML Reader from a file which returns all parsed strings as wide characters (wchar_t*).
irr::io::IFileSystem::createMemoryReadFile
virtual IReadFile * createMemoryReadFile(void *memory, s32 len, const path &fileName, bool deleteMemoryWhenDropped=false)=0
Creates an IReadFile interface for accessing memory like a file.
irr::io::IFileSystem::createXMLWriter
virtual IXMLWriter * createXMLWriter(IWriteFile *file)=0
Creates a XML Writer from a file.
irr::io::IFileSystem::getWorkingDirectory
virtual const path & getWorkingDirectory()=0
Get the current working directory.
irr::io::IFileSystem::flattenFilename
virtual path & flattenFilename(path &directory, const path &root="/") const =0
flatten a path and file name for example: "/you/me/../." becomes "/you"
irr::io::IFileSystem::setFileListSystem
virtual EFileSystemType setFileListSystem(EFileSystemType listType)=0
Set the active type of file system.
irr::io::IFileSystem::getAbsolutePath
virtual path getAbsolutePath(const path &filename) const =0
Converts a relative path to an absolute (unique) path, resolving symbolic links if required.
irr::io::IFileSystem::addFolderFileArchive
virtual _IRR_DEPRECATED_ bool addFolderFileArchive(const c8 *filename, bool ignoreCase=true, bool ignorePaths=true)
Adds an unzipped archive (or basedirectory with subdirectories..) to the file system.
Definition IFileSystem.h:244
irr::io::IFileSystem::getFileArchiveCount
virtual u32 getFileArchiveCount() const =0
Get the number of archives currently attached to the file system.
irr::io::IFileSystem::changeWorkingDirectoryTo
virtual bool changeWorkingDirectoryTo(const path &newDirectory)=0
Changes the current working directory.
irr::io::IFileSystem::createFileList
virtual IFileList * createFileList()=0
Creates a list of files and directories in the current working directory and returns it.
irr::io::IFileSystem::createXMLWriter
virtual IXMLWriter * createXMLWriter(const path &filename)=0
Creates a XML Writer from a file.
irr::io::IFileSystem::getFileArchive
virtual IFileArchive * getFileArchive(u32 index)=0
Get the archive at a given index.
irr::io::IFileSystem::getRelativeFilename
virtual path getRelativeFilename(const path &filename, const path &directory) const =0
Get the relative filename, relative to the given directory.
irr::io::IFileSystem::createXMLReaderUTF8
virtual IXMLReaderUTF8 * createXMLReaderUTF8(const path &filename)=0
Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
irr::io::IFileSystem::createXMLReaderUTF8
virtual IXMLReaderUTF8 * createXMLReaderUTF8(IReadFile *file)=0
Creates a XML Reader from a file which returns all parsed strings as ASCII/UTF-8 characters (char*).
irr::io::IFileSystem::getArchiveLoader
virtual IArchiveLoader * getArchiveLoader(u32 index) const =0
Retrieve the given archive loader.
irr::io::IFileSystem::removeFileArchive
virtual bool removeFileArchive(u32 index)=0
Removes an archive from the file system.
irr::io::IFileSystem::createAndOpenFile
virtual IReadFile * createAndOpenFile(const path &filename)=0
Opens a file for read access.
irr::io::IFileSystem::removeFileArchive
virtual bool removeFileArchive(const IFileArchive *archive)=0
Removes an archive from the file system.
irr::io::IFileSystem::addFileArchive
virtual bool addFileArchive(IReadFile *file, bool ignoreCase=true, bool ignorePaths=true, E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, const core::stringc &password="", IFileArchive **retArchive=0)=0
Adds an archive to the file system.
irr::io::IFileSystem::addArchiveLoader
virtual void addArchiveLoader(IArchiveLoader *loader)=0
Adds an external archive loader to the engine.
irr::io::IFileSystem::getFileDir
virtual path getFileDir(const path &filename) const =0
Get the directory a file is located in.
irr::io::IFileSystem::createEmptyFileList
virtual IFileList * createEmptyFileList(const io::path &path, bool ignoreCase, bool ignorePaths)=0
Creates an empty filelist.
irr::io::IFileSystem::getArchiveLoaderCount
virtual u32 getArchiveLoaderCount() const =0
Gets the number of archive loaders currently added.
irr::io::IFileSystem::createLimitReadFile
virtual IReadFile * createLimitReadFile(const path &fileName, IReadFile *alreadyOpenedFile, long pos, long areaSize)=0
Creates an IReadFile interface for accessing files inside files.
irr::io::IFileSystem::moveFileArchive
virtual bool moveFileArchive(u32 sourceIndex, s32 relative)=0
Changes the search order of attached archives.
irr::io::IFileSystem::addFileArchive
virtual bool addFileArchive(IFileArchive *archive)=0
Adds an archive to the file system.
irr::io::IFileSystem::addZipFileArchive
virtual _IRR_DEPRECATED_ bool addZipFileArchive(const c8 *filename, bool ignoreCase=true, bool ignorePaths=true)
Adds a zip archive to the file system.
Definition IFileSystem.h:228
irr::io::IFileSystem::addFileArchive
virtual bool addFileArchive(const path &filename, bool ignoreCase=true, bool ignorePaths=true, E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, const core::stringc &password="", IFileArchive **retArchive=0)=0
Adds an archive to the file system.
irr::io::IReadFile
Interface providing read acess to a file.
Definition IReadFile.h:18
irr::io::IWriteFile
Interface providing write access to a file.
Definition IWriteFile.h:18
irr::io::IXMLWriter
Interface providing methods for making it easier to write XML files.
Definition IXMLWriter.h:21
irr::video::IVideoDriver
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:257
_IRR_DEPRECATED_
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Definition irrTypes.h:195
irr::core::stringc
string< c8 > stringc
Typedef for character strings.
Definition irrString.h:1358
irr::io
This namespace provides interfaces for input/output: Reading and writing files, accessing zip archive...
Definition EAttributes.h:11
irr::io::EFileSystemType
EFileSystemType
FileSystemType: which Filesystem should be used for e.g. browsing.
Definition IFileArchive.h:19
irr::io::IXMLReaderUTF8
IIrrXMLReader< c8, IReferenceCounted > IXMLReaderUTF8
An xml reader for ASCII or UTF-8 characters, derived from IReferenceCounted.
Definition IXMLReader.h:25
irr::io::IXMLReader
IIrrXMLReader< wchar_t, IReferenceCounted > IXMLReader
An xml reader for wide characters, derived from IReferenceCounted.
Definition IXMLReader.h:19
irr::io::path
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
irr::io::E_FILE_ARCHIVE_TYPE
E_FILE_ARCHIVE_TYPE
Contains the different types of archives.
Definition IFileArchive.h:26
irr::io::EFAT_FOLDER
@ EFAT_FOLDER
A virtual directory.
Definition IFileArchive.h:34
irr::io::EFAT_UNKNOWN
@ EFAT_UNKNOWN
The type of this archive is unknown.
Definition IFileArchive.h:49
irr::io::EFAT_ZIP
@ EFAT_ZIP
A PKZIP archive.
Definition IFileArchive.h:28
irr::io::EFAT_PAK
@ EFAT_PAK
An ID Software PAK archive.
Definition IFileArchive.h:37
irr::video
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::c8
char c8
8 bit character variable.
Definition irrTypes.h:31
irr::s32
signed int s32
32 bit signed variable.
Definition irrTypes.h:66
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0