mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -11,7 +11,7 @@ namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class IVideoDriver;
|
||||
} // end namespace video
|
||||
namespace io
|
||||
{
|
||||
@ -21,7 +21,6 @@ class IWriteFile;
|
||||
class IFileList;
|
||||
class IAttributes;
|
||||
|
||||
|
||||
//! The FileSystem 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
|
||||
@ -29,13 +28,12 @@ as file on disk, using the IFileSystem makes no difference to this. */
|
||||
class IFileSystem : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Opens a file for read access.
|
||||
/** \param filename: Name of file to open.
|
||||
\return Pointer to the created file interface.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IReadFile* createAndOpenFile(const path& filename) =0;
|
||||
virtual IReadFile *createAndOpenFile(const path &filename) = 0;
|
||||
|
||||
//! Creates an IReadFile interface for accessing memory like a file.
|
||||
/** This allows you to use a pointer to memory where an IReadFile is requested.
|
||||
@ -48,7 +46,7 @@ public:
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IReadFile* createMemoryReadFile(const void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
|
||||
virtual IReadFile *createMemoryReadFile(const void *memory, s32 len, const path &fileName, bool deleteMemoryWhenDropped = false) = 0;
|
||||
|
||||
//! Creates an IReadFile interface for accessing files inside files.
|
||||
/** This is useful e.g. for archives.
|
||||
@ -60,8 +58,8 @@ public:
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IReadFile* createLimitReadFile(const path& fileName,
|
||||
IReadFile* alreadyOpenedFile, long pos, long areaSize) =0;
|
||||
virtual IReadFile *createLimitReadFile(const path &fileName,
|
||||
IReadFile *alreadyOpenedFile, long pos, long areaSize) = 0;
|
||||
|
||||
//! Creates an IWriteFile interface for accessing memory like a file.
|
||||
/** This allows you to use a pointer to memory where an IWriteFile is requested.
|
||||
@ -75,8 +73,7 @@ public:
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const path& fileName, bool deleteMemoryWhenDropped=false) =0;
|
||||
|
||||
virtual IWriteFile *createMemoryWriteFile(void *memory, s32 len, const path &fileName, bool deleteMemoryWhenDropped = false) = 0;
|
||||
|
||||
//! Opens a file for write access.
|
||||
/** \param filename: Name of file to open.
|
||||
@ -86,7 +83,7 @@ public:
|
||||
file could not created or opened for writing.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IWriteFile* createAndWriteFile(const path& filename, bool append=false) =0;
|
||||
virtual IWriteFile *createAndWriteFile(const path &filename, bool append = false) = 0;
|
||||
|
||||
//! Adds an archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will also search and open
|
||||
@ -110,11 +107,11 @@ public:
|
||||
\param password An optional password, which is used in case of encrypted archives.
|
||||
\param retArchive A pointer that will be set to the archive that is added.
|
||||
\return True if the archive was added successfully, false if not. */
|
||||
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(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.
|
||||
/** After calling this, the Irrlicht Engine will also search and open
|
||||
@ -142,19 +139,19 @@ public:
|
||||
\param password An optional password, which is used in case of encrypted archives.
|
||||
\param retArchive A pointer that will be set to the archive that is added.
|
||||
\return True if the archive was added successfully, false if not. */
|
||||
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(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.
|
||||
/** \param archive: The archive to add to the file system.
|
||||
\return True if the archive was added successfully, false if not. */
|
||||
virtual bool addFileArchive(IFileArchive* archive) =0;
|
||||
virtual bool addFileArchive(IFileArchive *archive) = 0;
|
||||
|
||||
//! Get the number of archives currently attached to the file system
|
||||
virtual u32 getFileArchiveCount() const =0;
|
||||
virtual u32 getFileArchiveCount() const = 0;
|
||||
|
||||
//! Removes an archive from the file system.
|
||||
/** This will close the archive and free any file handles, but will not
|
||||
@ -162,7 +159,7 @@ public:
|
||||
example textures and meshes.
|
||||
\param index: The index of the archive to remove
|
||||
\return True on success, false on failure */
|
||||
virtual bool removeFileArchive(u32 index) =0;
|
||||
virtual bool removeFileArchive(u32 index) = 0;
|
||||
|
||||
//! Removes an archive from the file system.
|
||||
/** This will close the archive and free any file handles, but will not
|
||||
@ -176,7 +173,7 @@ public:
|
||||
locating the archive to work with.
|
||||
\param filename The archive pointed to by the name will be removed
|
||||
\return True on success, false on failure */
|
||||
virtual bool removeFileArchive(const path& filename) =0;
|
||||
virtual bool removeFileArchive(const path &filename) = 0;
|
||||
|
||||
//! Removes an archive from the file system.
|
||||
/** This will close the archive and free any file handles, but will not
|
||||
@ -184,21 +181,21 @@ public:
|
||||
example textures and meshes.
|
||||
\param archive The archive to remove.
|
||||
\return True on success, false on failure */
|
||||
virtual bool removeFileArchive(const IFileArchive* archive) =0;
|
||||
virtual bool removeFileArchive(const IFileArchive *archive) = 0;
|
||||
|
||||
//! Changes the search order of attached archives.
|
||||
/**
|
||||
\param sourceIndex: The index of the archive to change
|
||||
\param relative: The relative change in position, archives with a lower index are searched first */
|
||||
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) =0;
|
||||
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) = 0;
|
||||
|
||||
//! Get the archive at a given index.
|
||||
virtual IFileArchive* getFileArchive(u32 index) =0;
|
||||
virtual IFileArchive *getFileArchive(u32 index) = 0;
|
||||
|
||||
//! Adds an external archive loader to the engine.
|
||||
/** Use this function to add support for new archive types to the
|
||||
engine, for example proprietary or encrypted file storage. */
|
||||
virtual void addArchiveLoader(IArchiveLoader* loader) =0;
|
||||
virtual void addArchiveLoader(IArchiveLoader *loader) = 0;
|
||||
|
||||
//! Gets the number of archive loaders currently added
|
||||
virtual u32 getArchiveLoaderCount() const = 0;
|
||||
@ -207,63 +204,62 @@ public:
|
||||
/** \param index The index of the loader to retrieve. This parameter is an 0-based
|
||||
array index.
|
||||
\return A pointer to the specified loader, 0 if the index is incorrect. */
|
||||
virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0;
|
||||
virtual IArchiveLoader *getArchiveLoader(u32 index) const = 0;
|
||||
|
||||
//! Get the current working directory.
|
||||
/** \return Current working directory as a string. */
|
||||
virtual const path& getWorkingDirectory() =0;
|
||||
virtual const path &getWorkingDirectory() = 0;
|
||||
|
||||
//! Changes the current working directory.
|
||||
/** \param newDirectory: A string specifying the new working directory.
|
||||
The string is operating system dependent. Under Windows it has
|
||||
the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
|
||||
\return True if successful, otherwise false. */
|
||||
virtual bool changeWorkingDirectoryTo(const path& newDirectory) =0;
|
||||
virtual bool changeWorkingDirectoryTo(const path &newDirectory) = 0;
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
|
||||
/** \param filename Possibly relative file or directory name to query.
|
||||
\result Absolute filename which points to the same file. */
|
||||
virtual path getAbsolutePath(const path& filename) const =0;
|
||||
virtual path getAbsolutePath(const path &filename) const = 0;
|
||||
|
||||
//! Get the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from.
|
||||
\return String containing the directory of the file. */
|
||||
virtual path getFileDir(const path& filename) const =0;
|
||||
virtual path getFileDir(const path &filename) const = 0;
|
||||
|
||||
//! Get the base part of a filename, i.e. the name without the directory part.
|
||||
/** If no directory is prefixed, the full name is returned.
|
||||
\param filename: The file to get the basename from
|
||||
\param keepExtension True if filename with extension is returned otherwise everything
|
||||
after the final '.' is removed as well. */
|
||||
virtual path getFileBasename(const path& filename, bool keepExtension=true) const =0;
|
||||
virtual path getFileBasename(const path &filename, bool keepExtension = true) const = 0;
|
||||
|
||||
//! flatten a path and file name for example: "/you/me/../." becomes "/you"
|
||||
virtual path& flattenFilename(path& directory, const path& root="/") const =0;
|
||||
virtual path &flattenFilename(path &directory, const path &root = "/") const = 0;
|
||||
|
||||
//! Get the relative filename, relative to the given directory
|
||||
virtual path getRelativeFilename(const path& filename, const path& directory) const =0;
|
||||
virtual path getRelativeFilename(const path &filename, const path &directory) const = 0;
|
||||
|
||||
//! Creates a list of files and directories in the current working directory and returns it.
|
||||
/** \return a Pointer to the created IFileList is returned. After the list has been used
|
||||
it has to be deleted using its IFileList::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createFileList() =0;
|
||||
virtual IFileList *createFileList() = 0;
|
||||
|
||||
//! Creates an empty filelist
|
||||
/** \return a Pointer to the created IFileList is returned. After the list has been used
|
||||
it has to be deleted using its IFileList::drop() method.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) =0;
|
||||
virtual IFileList *createEmptyFileList(const io::path &path, bool ignoreCase, bool ignorePaths) = 0;
|
||||
|
||||
//! Set the active type of file system.
|
||||
virtual EFileSystemType setFileListSystem(EFileSystemType listType) =0;
|
||||
virtual EFileSystemType setFileListSystem(EFileSystemType listType) = 0;
|
||||
|
||||
//! Determines if a file exists and could be opened.
|
||||
/** \param filename is the string identifying the file which should be tested for existence.
|
||||
\return True if file exists, and false if it does not exist or an error occurred. */
|
||||
virtual bool existFile(const path& filename) const =0;
|
||||
virtual bool existFile(const path &filename) const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user