Skip to content

Commit 7f5530d

Browse files
committed
refactor(format): Applies clang-format. (#493)
1 parent fa06fb8 commit 7f5530d

File tree

4,415 files changed

+614159
-570327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,415 files changed

+614159
-570327
lines changed

Core/GameEngine/Include/Common/ArchiveFile.h

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
class File;
3939

4040
/**
41-
* An archive file is itself a collection of sub files. Each file inside the archive file
42-
* has a unique name by which it can be accessed. The ArchiveFile object class is the
43-
* runtime interface to the mix file and the sub files. Each file inside the mix
44-
* file can be accessed by the openFile().
45-
*
46-
* ArchiveFile interfaces can be created by the TheArchiveFileSystem object.
47-
*/
41+
* An archive file is itself a collection of sub files. Each file inside the archive file
42+
* has a unique name by which it can be accessed. The ArchiveFile object class is the
43+
* runtime interface to the mix file and the sub files. Each file inside the mix
44+
* file can be accessed by the openFile().
45+
*
46+
* ArchiveFile interfaces can be created by the TheArchiveFileSystem object.
47+
*/
4848
//===============================
4949

5050
class ArchiveFile
@@ -53,24 +53,37 @@ class ArchiveFile
5353
ArchiveFile();
5454
virtual ~ArchiveFile();
5555

56-
virtual Bool getFileInfo( const AsciiString& filename, FileInfo *fileInfo) const = 0; ///< fill in the fileInfo struct with info about the file requested.
57-
virtual File* openFile( const Char *filename, Int access = 0) = 0; ///< Open the specified file within the archive file
58-
virtual void closeAllFiles( void ) = 0; ///< Close all file opened in this archive file
59-
virtual AsciiString getName( void ) = 0; ///< Returns the name of the archive file
60-
virtual AsciiString getPath( void ) = 0; ///< Returns full path and name of archive file
61-
virtual void setSearchPriority( Int new_priority ) = 0; ///< Set this archive file's search priority
62-
virtual void close( void ) = 0; ///< Close this archive file
63-
void attachFile(File *file);
56+
virtual Bool getFileInfo(const AsciiString &filename, FileInfo *fileInfo) const = 0; ///< fill in the fileInfo struct with
57+
///< info about the file requested.
58+
virtual File *openFile(const Char *filename, Int access = 0) = 0; ///< Open the specified file within the archive file
59+
virtual void closeAllFiles(void) = 0; ///< Close all file opened in this archive file
60+
virtual AsciiString getName(void) = 0; ///< Returns the name of the archive file
61+
virtual AsciiString getPath(void) = 0; ///< Returns full path and name of archive file
62+
virtual void setSearchPriority(Int new_priority) = 0; ///< Set this archive file's search priority
63+
virtual void close(void) = 0; ///< Close this archive file
64+
void attachFile(File *file);
6465

65-
void getFileListInDirectory(const AsciiString& currentDirectory, const AsciiString& originalDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const;
66-
void getFileListInDirectory(const DetailedArchivedDirectoryInfo *dirInfo, const AsciiString& currentDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const;
66+
void getFileListInDirectory(
67+
const AsciiString &currentDirectory,
68+
const AsciiString &originalDirectory,
69+
const AsciiString &searchName,
70+
FilenameList &filenameList,
71+
Bool searchSubdirectories) const;
72+
void getFileListInDirectory(
73+
const DetailedArchivedDirectoryInfo *dirInfo,
74+
const AsciiString &currentDirectory,
75+
const AsciiString &searchName,
76+
FilenameList &filenameList,
77+
Bool searchSubdirectories) const;
6778

68-
void addFile(const AsciiString& path, const ArchivedFileInfo *fileInfo); ///< add this file to our directory tree.
79+
void addFile(const AsciiString &path, const ArchivedFileInfo *fileInfo); ///< add this file to our directory tree.
6980

7081
protected:
71-
const ArchivedFileInfo * getArchivedFileInfo(const AsciiString& filename) const; ///< return the ArchivedFileInfo from the directory tree.
82+
const ArchivedFileInfo *getArchivedFileInfo(const AsciiString &filename) const; ///< return the ArchivedFileInfo from the
83+
///< directory tree.
7284

73-
File *m_file; ///< file pointer to the archive file on disk. Kept open so we don't have to continuously open and close the file all the time.
85+
File *m_file; ///< file pointer to the archive file on disk. Kept open so we don't have to continuously open and close the
86+
///< file all the time.
7487
DetailedArchivedDirectoryInfo m_rootDirectory;
7588
};
7689

Core/GameEngine/Include/Common/ArchiveFileSystem.h

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,16 @@ class ArchiveFile;
6868
// Type Defines
6969
//----------------------------------------------------------------------------
7070

71-
7271
//===============================
7372
// ArchiveFileSystem
7473
//===============================
7574
/**
76-
* Creates and manages ArchiveFile interfaces. ArchiveFiles can be accessed
77-
* by calling the openArchiveFile() member. ArchiveFiles can be accessed by
78-
* name or by File interface.
79-
*
80-
* openFile() member searches all Archive files for the specified sub file.
81-
*/
75+
* Creates and manages ArchiveFile interfaces. ArchiveFiles can be accessed
76+
* by calling the openArchiveFile() member. ArchiveFiles can be accessed by
77+
* name or by File interface.
78+
*
79+
* openFile() member searches all Archive files for the specified sub file.
80+
*/
8281
//===============================
8382
class ArchivedDirectoryInfo;
8483
class DetailedArchivedDirectoryInfo;
@@ -88,30 +87,30 @@ typedef std::map<AsciiString, DetailedArchivedDirectoryInfo> DetailedArchivedDir
8887
typedef std::map<AsciiString, ArchivedDirectoryInfo> ArchivedDirectoryInfoMap;
8988
typedef std::map<AsciiString, ArchivedFileInfo> ArchivedFileInfoMap;
9089
typedef std::map<AsciiString, ArchiveFile *> ArchiveFileMap;
91-
typedef std::map<AsciiString, AsciiString> ArchivedFileLocationMap; // first string is the file name, second one is the archive filename.
90+
typedef std::map<AsciiString, AsciiString> ArchivedFileLocationMap; // first string is the file name, second one is the
91+
// archive filename.
9292

9393
class ArchivedDirectoryInfo
9494
{
9595
public:
96-
AsciiString m_directoryName;
97-
ArchivedDirectoryInfoMap m_directories;
98-
ArchivedFileLocationMap m_files;
96+
AsciiString m_directoryName;
97+
ArchivedDirectoryInfoMap m_directories;
98+
ArchivedFileLocationMap m_files;
9999

100100
void clear()
101101
{
102102
m_directoryName.clear();
103103
m_directories.clear();
104104
m_files.clear();
105105
}
106-
107106
};
108107

109108
class DetailedArchivedDirectoryInfo
110109
{
111110
public:
112-
AsciiString m_directoryName;
113-
DetailedArchivedDirectoryInfoMap m_directories;
114-
ArchivedFileInfoMap m_files;
111+
AsciiString m_directoryName;
112+
DetailedArchivedDirectoryInfoMap m_directories;
113+
ArchivedFileInfoMap m_files;
115114

116115
void clear()
117116
{
@@ -129,10 +128,7 @@ class ArchivedFileInfo
129128
UnsignedInt m_offset;
130129
UnsignedInt m_size;
131130

132-
ArchivedFileInfo()
133-
{
134-
clear();
135-
}
131+
ArchivedFileInfo() { clear(); }
136132

137133
void clear()
138134
{
@@ -143,45 +139,55 @@ class ArchivedFileInfo
143139
}
144140
};
145141

146-
147142
class ArchiveFileSystem : public SubsystemInterface
148143
{
149-
public:
144+
public:
150145
ArchiveFileSystem();
151146
virtual ~ArchiveFileSystem();
152147

153-
virtual void init( void ) = 0;
154-
virtual void update( void ) = 0;
155-
virtual void reset( void ) = 0;
156-
virtual void postProcessLoad( void ) = 0;
148+
virtual void init(void) = 0;
149+
virtual void update(void) = 0;
150+
virtual void reset(void) = 0;
151+
virtual void postProcessLoad(void) = 0;
157152

158153
// ArchiveFile operations
159-
virtual ArchiveFile* openArchiveFile( const Char *filename ) = 0; ///< Create new or return existing Archive file from file name
160-
virtual void closeArchiveFile( const Char *filename ) = 0; ///< Close the one specified big file.
161-
virtual void closeAllArchiveFiles( void ) = 0; ///< Close all Archivefiles currently open
154+
virtual ArchiveFile *openArchiveFile(const Char *filename) = 0; ///< Create new or return existing Archive file from file
155+
///< name
156+
virtual void closeArchiveFile(const Char *filename) = 0; ///< Close the one specified big file.
157+
virtual void closeAllArchiveFiles(void) = 0; ///< Close all Archivefiles currently open
162158

163159
// File operations
164-
virtual File* openFile( const Char *filename, Int access = 0); ///< Search Archive files for specified file name and open it if found
165-
virtual void closeAllFiles( void ) = 0; ///< Close all files associated with ArchiveFiles
166-
virtual Bool doesFileExist(const Char *filename) const; ///< return true if that file exists in an archive file somewhere.
167-
168-
void getFileListInDirectory(const AsciiString& currentDirectory, const AsciiString& originalDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const; ///< search the given directory for files matching the searchName (egs. *.ini, *.rep). Possibly search subdirectories. Scans each Archive file.
169-
Bool getFileInfo(const AsciiString& filename, FileInfo *fileInfo) const; ///< see FileSystem.h
170-
171-
virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE) = 0;
160+
virtual File *openFile(const Char *filename, Int access = 0); ///< Search Archive files for specified file name and open it
161+
///< if found
162+
virtual void closeAllFiles(void) = 0; ///< Close all files associated with ArchiveFiles
163+
virtual Bool doesFileExist(const Char *filename) const; ///< return true if that file exists in an archive file somewhere.
164+
165+
void getFileListInDirectory(
166+
const AsciiString &currentDirectory,
167+
const AsciiString &originalDirectory,
168+
const AsciiString &searchName,
169+
FilenameList &filenameList,
170+
Bool searchSubdirectories) const; ///< search the given directory for files matching the searchName (egs. *.ini,
171+
///< *.rep). Possibly search subdirectories. Scans each Archive file.
172+
Bool getFileInfo(const AsciiString &filename, FileInfo *fileInfo) const; ///< see FileSystem.h
173+
174+
virtual Bool loadBigFilesFromDirectory(AsciiString dir, AsciiString fileMask, Bool overwrite = FALSE) = 0;
172175

173176
// Unprotected this for copy-protection routines
174-
AsciiString getArchiveFilenameForFile(const AsciiString& filename) const;
175-
void loadMods( void );
177+
AsciiString getArchiveFilenameForFile(const AsciiString &filename) const;
178+
void loadMods(void);
176179

177180
protected:
178-
virtual void loadIntoDirectoryTree(const ArchiveFile *archiveFile, const AsciiString& archiveFilename, Bool overwrite = FALSE ); ///< load the archive file's header information and apply it to the global archive directory tree.
181+
virtual void loadIntoDirectoryTree(
182+
const ArchiveFile *archiveFile,
183+
const AsciiString &archiveFilename,
184+
Bool overwrite = FALSE); ///< load the archive file's header information and apply it to the global archive directory
185+
///< tree.
179186

180187
ArchiveFileMap m_archiveFileMap;
181188
ArchivedDirectoryInfo m_rootDirectory;
182189
};
183190

184-
185191
extern ArchiveFileSystem *TheArchiveFileSystem;
186192

187193
//----------------------------------------------------------------------------

0 commit comments

Comments
 (0)