GCDTool/GCDTool/Elf/Sections/ElfSectionFactory.cs
2024-01-01 16:11:57 +01:00

14 lines
412 B
C#

namespace GCDTool.Elf.Sections;
sealed class ElfSectionFactory
{
public ElfSection CreateElfSection(SectionHeaderTableEntry section, string name)
{
return section.SectionType switch
{
ElfSectionType.Strtab => new ElfStrtab(section, name),
ElfSectionType.Symtab => new ElfSymtab(section, name),
_ => new ElfSection(section, name),
};
}
}