MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / createCustomArchive

Method createCustomArchive

TheForceEngine/TFE_Archive/archive.cpp:126–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126Archive* Archive::createCustomArchive(ArchiveType type, const char* path)
127{
128 ArchiveMap::iterator iArchive = s_archives[type].find(path);
129 if (iArchive != s_archives[type].end())
130 {
131 return iArchive->second;
132 }
133
134 Archive* archive = nullptr;
135 switch (type)
136 {
137 case ARCHIVE_GOB:
138 {
139 archive = new GobArchive();
140 }
141 break;
142 case ARCHIVE_LFD:
143 {
144 archive = new LfdArchive();
145 }
146 break;
147 case ARCHIVE_LAB:
148 {
149 archive = new LabArchive();
150 }
151 break;
152 case ARCHIVE_ZIP:
153 {
154 archive = new ZipArchive();
155 }
156 break;
157 default:
158 assert(0);
159 break;
160 };
161
162 if (archive)
163 {
164 strcpy(archive->m_name, path);
165 archive->create(path);
166 archive->m_type = type;
167 (s_archives[type])[path] = archive;
168 }
169 return archive;
170}
171
172void Archive::deleteCustomArchive(Archive* archive)
173{

Callers

nothing calls this directly

Calls 2

endMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected