Store record type as a part of construct function type

C++20
elsid 3 years ago
parent d097c16206
commit 082810f924
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -17,144 +17,143 @@ NIFFile::NIFFile(Files::IStreamPtr stream, const std::string &name)
parse(stream); parse(stream);
} }
template <typename NodeType> static std::unique_ptr<Record> construct() { return std::make_unique<NodeType>(); } template <typename NodeType, RecordType recordType>
static std::unique_ptr<Record> construct()
struct RecordFactoryEntry { {
auto result = std::make_unique<NodeType>();
using create_t = std::unique_ptr<Record> (*)(); result->recType = recordType;
return result;
create_t mCreate; }
RecordType mType;
}; using CreateRecord = std::unique_ptr<Record> (*)();
///These are all the record types we know how to read. ///These are all the record types we know how to read.
static std::map<std::string,RecordFactoryEntry> makeFactory() static std::map<std::string, CreateRecord> makeFactory()
{ {
std::map<std::string,RecordFactoryEntry> factory; return {
factory["NiNode"] = {&construct <NiNode> , RC_NiNode }; {"NiNode" , &construct <NiNode , RC_NiNode >},
factory["NiSwitchNode"] = {&construct <NiSwitchNode> , RC_NiSwitchNode }; {"NiSwitchNode" , &construct <NiSwitchNode , RC_NiSwitchNode >},
factory["NiLODNode"] = {&construct <NiLODNode> , RC_NiLODNode }; {"NiLODNode" , &construct <NiLODNode , RC_NiLODNode >},
factory["AvoidNode"] = {&construct <NiNode> , RC_AvoidNode }; {"AvoidNode" , &construct <NiNode , RC_AvoidNode >},
factory["NiCollisionSwitch"] = {&construct <NiNode> , RC_NiCollisionSwitch }; {"NiCollisionSwitch" , &construct <NiNode , RC_NiCollisionSwitch >},
factory["NiBSParticleNode"] = {&construct <NiNode> , RC_NiBSParticleNode }; {"NiBSParticleNode" , &construct <NiNode , RC_NiBSParticleNode >},
factory["NiBSAnimationNode"] = {&construct <NiNode> , RC_NiBSAnimationNode }; {"NiBSAnimationNode" , &construct <NiNode , RC_NiBSAnimationNode >},
factory["NiBillboardNode"] = {&construct <NiNode> , RC_NiBillboardNode }; {"NiBillboardNode" , &construct <NiNode , RC_NiBillboardNode >},
factory["NiTriShape"] = {&construct <NiTriShape> , RC_NiTriShape }; {"NiTriShape" , &construct <NiTriShape , RC_NiTriShape >},
factory["NiTriStrips"] = {&construct <NiTriStrips> , RC_NiTriStrips }; {"NiTriStrips" , &construct <NiTriStrips , RC_NiTriStrips >},
factory["NiLines"] = {&construct <NiLines> , RC_NiLines }; {"NiLines" , &construct <NiLines , RC_NiLines >},
factory["NiParticles"] = {&construct <NiParticles> , RC_NiParticles }; {"NiParticles" , &construct <NiParticles , RC_NiParticles >},
factory["NiRotatingParticles"] = {&construct <NiParticles> , RC_NiParticles }; {"NiRotatingParticles" , &construct <NiParticles , RC_NiParticles >},
factory["NiAutoNormalParticles"] = {&construct <NiParticles> , RC_NiParticles }; {"NiAutoNormalParticles" , &construct <NiParticles , RC_NiParticles >},
factory["NiCamera"] = {&construct <NiCamera> , RC_NiCamera }; {"NiCamera" , &construct <NiCamera , RC_NiCamera >},
factory["RootCollisionNode"] = {&construct <NiNode> , RC_RootCollisionNode }; {"RootCollisionNode" , &construct <NiNode , RC_RootCollisionNode >},
factory["NiTexturingProperty"] = {&construct <NiTexturingProperty> , RC_NiTexturingProperty }; {"NiTexturingProperty" , &construct <NiTexturingProperty , RC_NiTexturingProperty >},
factory["NiFogProperty"] = {&construct <NiFogProperty> , RC_NiFogProperty }; {"NiFogProperty" , &construct <NiFogProperty , RC_NiFogProperty >},
factory["NiMaterialProperty"] = {&construct <NiMaterialProperty> , RC_NiMaterialProperty }; {"NiMaterialProperty" , &construct <NiMaterialProperty , RC_NiMaterialProperty >},
factory["NiZBufferProperty"] = {&construct <NiZBufferProperty> , RC_NiZBufferProperty }; {"NiZBufferProperty" , &construct <NiZBufferProperty , RC_NiZBufferProperty >},
factory["NiAlphaProperty"] = {&construct <NiAlphaProperty> , RC_NiAlphaProperty }; {"NiAlphaProperty" , &construct <NiAlphaProperty , RC_NiAlphaProperty >},
factory["NiVertexColorProperty"] = {&construct <NiVertexColorProperty> , RC_NiVertexColorProperty }; {"NiVertexColorProperty" , &construct <NiVertexColorProperty , RC_NiVertexColorProperty >},
factory["NiShadeProperty"] = {&construct <NiShadeProperty> , RC_NiShadeProperty }; {"NiShadeProperty" , &construct <NiShadeProperty , RC_NiShadeProperty >},
factory["NiDitherProperty"] = {&construct <NiDitherProperty> , RC_NiDitherProperty }; {"NiDitherProperty" , &construct <NiDitherProperty , RC_NiDitherProperty >},
factory["NiWireframeProperty"] = {&construct <NiWireframeProperty> , RC_NiWireframeProperty }; {"NiWireframeProperty" , &construct <NiWireframeProperty , RC_NiWireframeProperty >},
factory["NiSpecularProperty"] = {&construct <NiSpecularProperty> , RC_NiSpecularProperty }; {"NiSpecularProperty" , &construct <NiSpecularProperty , RC_NiSpecularProperty >},
factory["NiStencilProperty"] = {&construct <NiStencilProperty> , RC_NiStencilProperty }; {"NiStencilProperty" , &construct <NiStencilProperty , RC_NiStencilProperty >},
factory["NiVisController"] = {&construct <NiVisController> , RC_NiVisController }; {"NiVisController" , &construct <NiVisController , RC_NiVisController >},
factory["NiGeomMorpherController"] = {&construct <NiGeomMorpherController> , RC_NiGeomMorpherController }; {"NiGeomMorpherController" , &construct <NiGeomMorpherController , RC_NiGeomMorpherController >},
factory["NiKeyframeController"] = {&construct <NiKeyframeController> , RC_NiKeyframeController }; {"NiKeyframeController" , &construct <NiKeyframeController , RC_NiKeyframeController >},
factory["NiAlphaController"] = {&construct <NiAlphaController> , RC_NiAlphaController }; {"NiAlphaController" , &construct <NiAlphaController , RC_NiAlphaController >},
factory["NiRollController"] = {&construct <NiRollController> , RC_NiRollController }; {"NiRollController" , &construct <NiRollController , RC_NiRollController >},
factory["NiUVController"] = {&construct <NiUVController> , RC_NiUVController }; {"NiUVController" , &construct <NiUVController , RC_NiUVController >},
factory["NiPathController"] = {&construct <NiPathController> , RC_NiPathController }; {"NiPathController" , &construct <NiPathController , RC_NiPathController >},
factory["NiMaterialColorController"] = {&construct <NiMaterialColorController> , RC_NiMaterialColorController }; {"NiMaterialColorController" , &construct <NiMaterialColorController , RC_NiMaterialColorController >},
factory["NiBSPArrayController"] = {&construct <NiBSPArrayController> , RC_NiBSPArrayController }; {"NiBSPArrayController" , &construct <NiBSPArrayController , RC_NiBSPArrayController >},
factory["NiParticleSystemController"] = {&construct <NiParticleSystemController> , RC_NiParticleSystemController }; {"NiParticleSystemController" , &construct <NiParticleSystemController , RC_NiParticleSystemController >},
factory["NiFlipController"] = {&construct <NiFlipController> , RC_NiFlipController }; {"NiFlipController" , &construct <NiFlipController , RC_NiFlipController >},
factory["NiAmbientLight"] = {&construct <NiLight> , RC_NiLight }; {"NiAmbientLight" , &construct <NiLight , RC_NiLight >},
factory["NiDirectionalLight"] = {&construct <NiLight> , RC_NiLight }; {"NiDirectionalLight" , &construct <NiLight , RC_NiLight >},
factory["NiPointLight"] = {&construct <NiPointLight> , RC_NiLight }; {"NiPointLight" , &construct <NiPointLight , RC_NiLight >},
factory["NiSpotLight"] = {&construct <NiSpotLight> , RC_NiLight }; {"NiSpotLight" , &construct <NiSpotLight , RC_NiLight >},
factory["NiTextureEffect"] = {&construct <NiTextureEffect> , RC_NiTextureEffect }; {"NiTextureEffect" , &construct <NiTextureEffect , RC_NiTextureEffect >},
factory["NiExtraData"] = {&construct <NiExtraData> , RC_NiExtraData }; {"NiExtraData" , &construct <NiExtraData , RC_NiExtraData >},
factory["NiVertWeightsExtraData"] = {&construct <NiVertWeightsExtraData> , RC_NiVertWeightsExtraData }; {"NiVertWeightsExtraData" , &construct <NiVertWeightsExtraData , RC_NiVertWeightsExtraData >},
factory["NiTextKeyExtraData"] = {&construct <NiTextKeyExtraData> , RC_NiTextKeyExtraData }; {"NiTextKeyExtraData" , &construct <NiTextKeyExtraData , RC_NiTextKeyExtraData >},
factory["NiStringExtraData"] = {&construct <NiStringExtraData> , RC_NiStringExtraData }; {"NiStringExtraData" , &construct <NiStringExtraData , RC_NiStringExtraData >},
factory["NiGravity"] = {&construct <NiGravity> , RC_NiGravity }; {"NiGravity" , &construct <NiGravity , RC_NiGravity >},
factory["NiPlanarCollider"] = {&construct <NiPlanarCollider> , RC_NiPlanarCollider }; {"NiPlanarCollider" , &construct <NiPlanarCollider , RC_NiPlanarCollider >},
factory["NiSphericalCollider"] = {&construct <NiSphericalCollider> , RC_NiSphericalCollider }; {"NiSphericalCollider" , &construct <NiSphericalCollider , RC_NiSphericalCollider >},
factory["NiParticleGrowFade"] = {&construct <NiParticleGrowFade> , RC_NiParticleGrowFade }; {"NiParticleGrowFade" , &construct <NiParticleGrowFade , RC_NiParticleGrowFade >},
factory["NiParticleColorModifier"] = {&construct <NiParticleColorModifier> , RC_NiParticleColorModifier }; {"NiParticleColorModifier" , &construct <NiParticleColorModifier , RC_NiParticleColorModifier >},
factory["NiParticleRotation"] = {&construct <NiParticleRotation> , RC_NiParticleRotation }; {"NiParticleRotation" , &construct <NiParticleRotation , RC_NiParticleRotation >},
factory["NiFloatData"] = {&construct <NiFloatData> , RC_NiFloatData }; {"NiFloatData" , &construct <NiFloatData , RC_NiFloatData >},
factory["NiTriShapeData"] = {&construct <NiTriShapeData> , RC_NiTriShapeData }; {"NiTriShapeData" , &construct <NiTriShapeData , RC_NiTriShapeData >},
factory["NiTriStripsData"] = {&construct <NiTriStripsData> , RC_NiTriStripsData }; {"NiTriStripsData" , &construct <NiTriStripsData , RC_NiTriStripsData >},
factory["NiLinesData"] = {&construct <NiLinesData> , RC_NiLinesData }; {"NiLinesData" , &construct <NiLinesData , RC_NiLinesData >},
factory["NiVisData"] = {&construct <NiVisData> , RC_NiVisData }; {"NiVisData" , &construct <NiVisData , RC_NiVisData >},
factory["NiColorData"] = {&construct <NiColorData> , RC_NiColorData }; {"NiColorData" , &construct <NiColorData , RC_NiColorData >},
factory["NiPixelData"] = {&construct <NiPixelData> , RC_NiPixelData }; {"NiPixelData" , &construct <NiPixelData , RC_NiPixelData >},
factory["NiMorphData"] = {&construct <NiMorphData> , RC_NiMorphData }; {"NiMorphData" , &construct <NiMorphData , RC_NiMorphData >},
factory["NiKeyframeData"] = {&construct <NiKeyframeData> , RC_NiKeyframeData }; {"NiKeyframeData" , &construct <NiKeyframeData , RC_NiKeyframeData >},
factory["NiSkinData"] = {&construct <NiSkinData> , RC_NiSkinData }; {"NiSkinData" , &construct <NiSkinData , RC_NiSkinData >},
factory["NiUVData"] = {&construct <NiUVData> , RC_NiUVData }; {"NiUVData" , &construct <NiUVData , RC_NiUVData >},
factory["NiPosData"] = {&construct <NiPosData> , RC_NiPosData }; {"NiPosData" , &construct <NiPosData , RC_NiPosData >},
factory["NiParticlesData"] = {&construct <NiParticlesData> , RC_NiParticlesData }; {"NiParticlesData" , &construct <NiParticlesData , RC_NiParticlesData >},
factory["NiRotatingParticlesData"] = {&construct <NiRotatingParticlesData> , RC_NiParticlesData }; {"NiRotatingParticlesData" , &construct <NiRotatingParticlesData , RC_NiParticlesData >},
factory["NiAutoNormalParticlesData"] = {&construct <NiParticlesData> , RC_NiParticlesData }; {"NiAutoNormalParticlesData" , &construct <NiParticlesData , RC_NiParticlesData >},
factory["NiSequenceStreamHelper"] = {&construct <NiSequenceStreamHelper> , RC_NiSequenceStreamHelper }; {"NiSequenceStreamHelper" , &construct <NiSequenceStreamHelper , RC_NiSequenceStreamHelper >},
factory["NiSourceTexture"] = {&construct <NiSourceTexture> , RC_NiSourceTexture }; {"NiSourceTexture" , &construct <NiSourceTexture , RC_NiSourceTexture >},
factory["NiSkinInstance"] = {&construct <NiSkinInstance> , RC_NiSkinInstance }; {"NiSkinInstance" , &construct <NiSkinInstance , RC_NiSkinInstance >},
factory["NiLookAtController"] = {&construct <NiLookAtController> , RC_NiLookAtController }; {"NiLookAtController" , &construct <NiLookAtController , RC_NiLookAtController >},
factory["NiPalette"] = {&construct <NiPalette> , RC_NiPalette }; {"NiPalette" , &construct <NiPalette , RC_NiPalette >},
factory["NiIntegerExtraData"] = {&construct <NiIntegerExtraData> , RC_NiIntegerExtraData }; {"NiIntegerExtraData" , &construct <NiIntegerExtraData , RC_NiIntegerExtraData >},
factory["NiIntegersExtraData"] = {&construct <NiIntegersExtraData> , RC_NiIntegersExtraData }; {"NiIntegersExtraData" , &construct <NiIntegersExtraData , RC_NiIntegersExtraData >},
factory["NiBinaryExtraData"] = {&construct <NiBinaryExtraData> , RC_NiBinaryExtraData }; {"NiBinaryExtraData" , &construct <NiBinaryExtraData , RC_NiBinaryExtraData >},
factory["NiBooleanExtraData"] = {&construct <NiBooleanExtraData> , RC_NiBooleanExtraData }; {"NiBooleanExtraData" , &construct <NiBooleanExtraData , RC_NiBooleanExtraData >},
factory["NiVectorExtraData"] = {&construct <NiVectorExtraData> , RC_NiVectorExtraData }; {"NiVectorExtraData" , &construct <NiVectorExtraData , RC_NiVectorExtraData >},
factory["NiColorExtraData"] = {&construct <NiVectorExtraData> , RC_NiColorExtraData }; {"NiColorExtraData" , &construct <NiVectorExtraData , RC_NiColorExtraData >},
factory["NiFloatExtraData"] = {&construct <NiFloatExtraData> , RC_NiFloatExtraData }; {"NiFloatExtraData" , &construct <NiFloatExtraData , RC_NiFloatExtraData >},
factory["NiFloatsExtraData"] = {&construct <NiFloatsExtraData> , RC_NiFloatsExtraData }; {"NiFloatsExtraData" , &construct <NiFloatsExtraData , RC_NiFloatsExtraData >},
factory["NiStringPalette"] = {&construct <NiStringPalette> , RC_NiStringPalette }; {"NiStringPalette" , &construct <NiStringPalette , RC_NiStringPalette >},
factory["NiBoolData"] = {&construct <NiBoolData> , RC_NiBoolData }; {"NiBoolData" , &construct <NiBoolData , RC_NiBoolData >},
factory["NiSkinPartition"] = {&construct <NiSkinPartition> , RC_NiSkinPartition }; {"NiSkinPartition" , &construct <NiSkinPartition , RC_NiSkinPartition >},
factory["BSXFlags"] = {&construct <NiIntegerExtraData> , RC_BSXFlags }; {"BSXFlags" , &construct <NiIntegerExtraData , RC_BSXFlags >},
factory["BSBound"] = {&construct <BSBound> , RC_BSBound }; {"BSBound" , &construct <BSBound , RC_BSBound >},
factory["NiTransformData"] = {&construct <NiKeyframeData> , RC_NiKeyframeData }; {"NiTransformData" , &construct <NiKeyframeData , RC_NiKeyframeData >},
factory["BSFadeNode"] = {&construct <NiNode> , RC_NiNode }; {"BSFadeNode" , &construct <NiNode , RC_NiNode >},
factory["bhkBlendController"] = {&construct <bhkBlendController> , RC_bhkBlendController }; {"bhkBlendController" , &construct <bhkBlendController , RC_bhkBlendController >},
factory["NiFloatInterpolator"] = {&construct <NiFloatInterpolator> , RC_NiFloatInterpolator }; {"NiFloatInterpolator" , &construct <NiFloatInterpolator , RC_NiFloatInterpolator >},
factory["NiBoolInterpolator"] = {&construct <NiBoolInterpolator> , RC_NiBoolInterpolator }; {"NiBoolInterpolator" , &construct <NiBoolInterpolator , RC_NiBoolInterpolator >},
factory["NiPoint3Interpolator"] = {&construct <NiPoint3Interpolator> , RC_NiPoint3Interpolator }; {"NiPoint3Interpolator" , &construct <NiPoint3Interpolator , RC_NiPoint3Interpolator >},
factory["NiTransformController"] = {&construct <NiKeyframeController> , RC_NiKeyframeController }; {"NiTransformController" , &construct <NiKeyframeController , RC_NiKeyframeController >},
factory["NiTransformInterpolator"] = {&construct <NiTransformInterpolator> , RC_NiTransformInterpolator }; {"NiTransformInterpolator" , &construct <NiTransformInterpolator , RC_NiTransformInterpolator >},
factory["NiColorInterpolator"] = {&construct <NiColorInterpolator> , RC_NiColorInterpolator }; {"NiColorInterpolator" , &construct <NiColorInterpolator , RC_NiColorInterpolator >},
factory["BSShaderTextureSet"] = {&construct <BSShaderTextureSet> , RC_BSShaderTextureSet }; {"BSShaderTextureSet" , &construct <BSShaderTextureSet , RC_BSShaderTextureSet >},
factory["BSLODTriShape"] = {&construct <BSLODTriShape> , RC_BSLODTriShape }; {"BSLODTriShape" , &construct <BSLODTriShape , RC_BSLODTriShape >},
factory["BSShaderProperty"] = {&construct <BSShaderProperty> , RC_BSShaderProperty }; {"BSShaderProperty" , &construct <BSShaderProperty , RC_BSShaderProperty >},
factory["BSShaderPPLightingProperty"] = {&construct <BSShaderPPLightingProperty> , RC_BSShaderPPLightingProperty }; {"BSShaderPPLightingProperty" , &construct <BSShaderPPLightingProperty , RC_BSShaderPPLightingProperty >},
factory["BSShaderNoLightingProperty"] = {&construct <BSShaderNoLightingProperty> , RC_BSShaderNoLightingProperty }; {"BSShaderNoLightingProperty" , &construct <BSShaderNoLightingProperty , RC_BSShaderNoLightingProperty >},
factory["BSFurnitureMarker"] = {&construct <BSFurnitureMarker> , RC_BSFurnitureMarker }; {"BSFurnitureMarker" , &construct <BSFurnitureMarker , RC_BSFurnitureMarker >},
factory["NiCollisionObject"] = {&construct <NiCollisionObject> , RC_NiCollisionObject }; {"NiCollisionObject" , &construct <NiCollisionObject , RC_NiCollisionObject >},
factory["bhkCollisionObject"] = {&construct <bhkCollisionObject> , RC_bhkCollisionObject }; {"bhkCollisionObject" , &construct <bhkCollisionObject , RC_bhkCollisionObject >},
factory["BSDismemberSkinInstance"] = {&construct <BSDismemberSkinInstance> , RC_BSDismemberSkinInstance }; {"BSDismemberSkinInstance" , &construct <BSDismemberSkinInstance , RC_BSDismemberSkinInstance >},
factory["NiControllerManager"] = {&construct <NiControllerManager> , RC_NiControllerManager }; {"NiControllerManager" , &construct <NiControllerManager , RC_NiControllerManager >},
factory["bhkMoppBvTreeShape"] = {&construct <bhkMoppBvTreeShape> , RC_bhkMoppBvTreeShape }; {"bhkMoppBvTreeShape" , &construct <bhkMoppBvTreeShape , RC_bhkMoppBvTreeShape >},
factory["bhkNiTriStripsShape"] = {&construct <bhkNiTriStripsShape> , RC_bhkNiTriStripsShape }; {"bhkNiTriStripsShape" , &construct <bhkNiTriStripsShape , RC_bhkNiTriStripsShape >},
factory["bhkPackedNiTriStripsShape"] = {&construct <bhkPackedNiTriStripsShape> , RC_bhkPackedNiTriStripsShape }; {"bhkPackedNiTriStripsShape" , &construct <bhkPackedNiTriStripsShape , RC_bhkPackedNiTriStripsShape >},
factory["hkPackedNiTriStripsData"] = {&construct <hkPackedNiTriStripsData> , RC_hkPackedNiTriStripsData }; {"hkPackedNiTriStripsData" , &construct <hkPackedNiTriStripsData , RC_hkPackedNiTriStripsData >},
factory["bhkConvexVerticesShape"] = {&construct <bhkConvexVerticesShape> , RC_bhkConvexVerticesShape }; {"bhkConvexVerticesShape" , &construct <bhkConvexVerticesShape , RC_bhkConvexVerticesShape >},
factory["bhkBoxShape"] = {&construct <bhkBoxShape> , RC_bhkBoxShape }; {"bhkBoxShape" , &construct <bhkBoxShape , RC_bhkBoxShape >},
factory["bhkListShape"] = {&construct <bhkListShape> , RC_bhkListShape }; {"bhkListShape" , &construct <bhkListShape , RC_bhkListShape >},
factory["bhkRigidBody"] = {&construct <bhkRigidBody> , RC_bhkRigidBody }; {"bhkRigidBody" , &construct <bhkRigidBody , RC_bhkRigidBody >},
factory["bhkRigidBodyT"] = {&construct <bhkRigidBody> , RC_bhkRigidBodyT }; {"bhkRigidBodyT" , &construct <bhkRigidBody , RC_bhkRigidBodyT >},
factory["BSLightingShaderProperty"] = {&construct <BSLightingShaderProperty> , RC_BSLightingShaderProperty }; {"BSLightingShaderProperty" , &construct <BSLightingShaderProperty , RC_BSLightingShaderProperty >},
factory["NiSortAdjustNode"] = {&construct <NiSortAdjustNode> , RC_NiNode }; {"NiSortAdjustNode" , &construct <NiSortAdjustNode , RC_NiNode >},
factory["NiClusterAccumulator"] = {&construct <NiClusterAccumulator> , RC_NiClusterAccumulator }; {"NiClusterAccumulator" , &construct <NiClusterAccumulator , RC_NiClusterAccumulator >},
factory["NiAlphaAccumulator"] = {&construct <NiAlphaAccumulator> , RC_NiAlphaAccumulator }; {"NiAlphaAccumulator" , &construct <NiAlphaAccumulator , RC_NiAlphaAccumulator >},
return factory; };
} }
///Make the factory map used for parsing the file ///Make the factory map used for parsing the file
static const std::map<std::string,RecordFactoryEntry> factories = makeFactory(); static const std::map<std::string, CreateRecord> factories = makeFactory();
std::string NIFFile::printVersion(unsigned int version) std::string NIFFile::printVersion(unsigned int version)
{ {
@ -305,16 +304,13 @@ void NIFFile::parse(Files::IStreamPtr stream)
} }
} }
std::map<std::string,RecordFactoryEntry>::const_iterator entry = factories.find(rec); const auto entry = factories.find(rec);
if (entry != factories.end()) if (entry == factories.end())
{
r = entry->second.mCreate();
r->recType = entry->second.mType;
}
else
fail("Unknown record type " + rec); fail("Unknown record type " + rec);
r = entry->second();
if (!supported) if (!supported)
Log(Debug::Verbose) << "NIF Debug: Reading record of type " << rec << ", index " << i << " (" << filename << ")"; Log(Debug::Verbose) << "NIF Debug: Reading record of type " << rec << ", index " << i << " (" << filename << ")";

Loading…
Cancel
Save