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:
@ -16,54 +16,53 @@ namespace io
|
||||
//! FileSystemType: which filesystem should be used for e.g. browsing
|
||||
enum EFileSystemType
|
||||
{
|
||||
FILESYSTEM_NATIVE = 0, // Native OS FileSystem
|
||||
FILESYSTEM_VIRTUAL // Virtual FileSystem
|
||||
FILESYSTEM_NATIVE = 0, // Native OS FileSystem
|
||||
FILESYSTEM_VIRTUAL // Virtual FileSystem
|
||||
};
|
||||
|
||||
//! Contains the different types of archives
|
||||
enum E_FILE_ARCHIVE_TYPE
|
||||
{
|
||||
//! A PKZIP archive
|
||||
EFAT_ZIP = MAKE_IRR_ID('Z','I','P', 0),
|
||||
EFAT_ZIP = MAKE_IRR_ID('Z', 'I', 'P', 0),
|
||||
|
||||
//! A gzip archive
|
||||
EFAT_GZIP = MAKE_IRR_ID('g','z','i','p'),
|
||||
EFAT_GZIP = MAKE_IRR_ID('g', 'z', 'i', 'p'),
|
||||
|
||||
//! An Android asset file archive
|
||||
EFAT_ANDROID_ASSET = MAKE_IRR_ID('A','S','S','E'),
|
||||
//! An Android asset file archive
|
||||
EFAT_ANDROID_ASSET = MAKE_IRR_ID('A', 'S', 'S', 'E'),
|
||||
|
||||
//! The type of this archive is unknown
|
||||
EFAT_UNKNOWN = MAKE_IRR_ID('u','n','k','n')
|
||||
EFAT_UNKNOWN = MAKE_IRR_ID('u', 'n', 'k', 'n')
|
||||
};
|
||||
|
||||
//! The FileArchive manages archives and provides access to files inside them.
|
||||
class IFileArchive : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Opens a file based on its name
|
||||
/** Creates and returns a new IReadFile for a file in the archive.
|
||||
\param filename The file to open
|
||||
\return Returns A pointer to the created file on success,
|
||||
or 0 on failure. */
|
||||
virtual IReadFile* createAndOpenFile(const path& filename) =0;
|
||||
virtual IReadFile *createAndOpenFile(const path &filename) = 0;
|
||||
|
||||
//! Opens a file based on its position in the file list.
|
||||
/** Creates and returns
|
||||
\param index The zero based index of the file.
|
||||
\return Returns a pointer to the created file on success, or 0 on failure. */
|
||||
virtual IReadFile* createAndOpenFile(u32 index) =0;
|
||||
virtual IReadFile *createAndOpenFile(u32 index) = 0;
|
||||
|
||||
//! Returns the complete file tree
|
||||
/** \return Returns the complete directory tree for the archive,
|
||||
including all files and folders */
|
||||
virtual const IFileList* getFileList() const =0;
|
||||
virtual const IFileList *getFileList() const = 0;
|
||||
|
||||
//! get the archive type
|
||||
virtual E_FILE_ARCHIVE_TYPE getType() const { return EFAT_UNKNOWN; }
|
||||
|
||||
//! return the name (id) of the file Archive
|
||||
virtual const io::path& getArchiveName() const =0;
|
||||
virtual const io::path &getArchiveName() const = 0;
|
||||
|
||||
//! Add a directory in the archive and all it's files to the FileList
|
||||
/** Only needed for file-archives which have no information about their own
|
||||
@ -95,35 +94,34 @@ public:
|
||||
/** Check based on the file extension (e.g. ".zip")
|
||||
\param filename Name of file to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(const path& filename) const =0;
|
||||
virtual bool isALoadableFileFormat(const path &filename) const = 0;
|
||||
|
||||
//! Check if the file might be loaded by this class
|
||||
/** This check may look into the file.
|
||||
\param file File handle to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const =0;
|
||||
virtual bool isALoadableFileFormat(io::IReadFile *file) const = 0;
|
||||
|
||||
//! Check to see if the loader can create archives of this type.
|
||||
/** Check based on the archive type.
|
||||
\param fileType The archive type to check.
|
||||
\return True if the archive loader supports this type, false if not */
|
||||
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const =0;
|
||||
virtual bool isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const = 0;
|
||||
|
||||
//! Creates an archive from the filename
|
||||
/** \param filename File to use.
|
||||
\param ignoreCase Searching is performed without regarding the case
|
||||
\param ignorePaths Files are searched for without checking for the directories
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const =0;
|
||||
virtual IFileArchive *createArchive(const path &filename, bool ignoreCase, bool ignorePaths) const = 0;
|
||||
|
||||
//! Creates an archive from the file
|
||||
/** \param file File handle to use.
|
||||
\param ignoreCase Searching is performed without regarding the case
|
||||
\param ignorePaths Files are searched for without checking for the directories
|
||||
\return Pointer to newly created archive, or 0 upon error. */
|
||||
virtual IFileArchive* createArchive(io::IReadFile* file, bool ignoreCase, bool ignorePaths) const =0;
|
||||
virtual IFileArchive *createArchive(io::IReadFile *file, bool ignoreCase, bool ignorePaths) const = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace io
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user