Rename new StructuredDataDefDumper

This commit is contained in:
Jan 2022-03-20 19:35:52 +01:00
parent 9f0852485d
commit 833b158a64
3 changed files with 11 additions and 11 deletions

View File

@ -189,10 +189,10 @@ void AssetDumperStructuredDataDefSet::DumpAsset(AssetDumpingContext& context, XA
if (!assetFile || set->defs == nullptr) if (!assetFile || set->defs == nullptr)
return; return;
StructuredDataDefDumperNew newDumper(*assetFile); StructuredDataDefDumper dumper(*assetFile);
for (auto i = 0u; i < set->defCount; i++) for (auto i = 0u; i < set->defCount; i++)
{ {
const auto def = ConvertDef(&set->defs[i]); const auto def = ConvertDef(&set->defs[i]);
newDumper.DumpDef(*def); dumper.DumpDef(*def);
} }
} }

View File

@ -5,19 +5,19 @@
#include "Utils/Alignment.h" #include "Utils/Alignment.h"
StructuredDataDefDumperNew::StructuredDataDefDumperNew(std::ostream& stream) StructuredDataDefDumper::StructuredDataDefDumper(std::ostream& stream)
: AbstractTextDumper(stream), : AbstractTextDumper(stream),
m_flags{} m_flags{}
{ {
} }
void StructuredDataDefDumperNew::WriteLineComment(const std::string& comment) const void StructuredDataDefDumper::WriteLineComment(const std::string& comment) const
{ {
Indent(); Indent();
m_stream << "// " << comment << "\n"; m_stream << "// " << comment << "\n";
} }
void StructuredDataDefDumperNew::DumpEnum(const CommonStructuredDataEnum& _enum) void StructuredDataDefDumper::DumpEnum(const CommonStructuredDataEnum& _enum)
{ {
Indent(); Indent();
@ -49,7 +49,7 @@ void StructuredDataDefDumperNew::DumpEnum(const CommonStructuredDataEnum& _enum)
m_stream << "};\n"; // end enum m_stream << "};\n"; // end enum
} }
void StructuredDataDefDumperNew::DumpType(const CommonStructuredDataDef& def, CommonStructuredDataType type, std::string& typeName, std::vector<std::string>& arraySpecifiers) const void StructuredDataDefDumper::DumpType(const CommonStructuredDataDef& def, CommonStructuredDataType type, std::string& typeName, std::vector<std::string>& arraySpecifiers) const
{ {
while (type.m_category != CommonStructuredDataTypeCategory::UNKNOWN) while (type.m_category != CommonStructuredDataTypeCategory::UNKNOWN)
{ {
@ -131,7 +131,7 @@ void StructuredDataDefDumperNew::DumpType(const CommonStructuredDataDef& def, Co
} }
} }
void StructuredDataDefDumperNew::DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, unsigned& currentOffsetInBit) const void StructuredDataDefDumper::DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, unsigned& currentOffsetInBit) const
{ {
std::string typeName; std::string typeName;
std::vector<std::string> arraySpecifiers; std::vector<std::string> arraySpecifiers;
@ -178,7 +178,7 @@ void StructuredDataDefDumperNew::DumpProperty(const CommonStructuredDataDef& def
currentOffsetInBit += property.m_type.GetSizeInBits(def); currentOffsetInBit += property.m_type.GetSizeInBits(def);
} }
void StructuredDataDefDumperNew::DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, const size_t structIndex) void StructuredDataDefDumper::DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, const size_t structIndex)
{ {
#ifdef STRUCTUREDDATADEF_DEBUG #ifdef STRUCTUREDDATADEF_DEBUG
Indent(); Indent();
@ -212,7 +212,7 @@ void StructuredDataDefDumperNew::DumpStruct(const CommonStructuredDataDef& def,
m_stream << "};\n"; // end struct m_stream << "};\n"; // end struct
} }
void StructuredDataDefDumperNew::DumpDef(const CommonStructuredDataDef& def) void StructuredDataDefDumper::DumpDef(const CommonStructuredDataDef& def)
{ {
if (m_flags.m_empty_line_before_definition) if (m_flags.m_empty_line_before_definition)
m_stream << "\n\n"; m_stream << "\n\n";

View File

@ -6,7 +6,7 @@
#include "Dumping/AbstractTextDumper.h" #include "Dumping/AbstractTextDumper.h"
#include "StructuredDataDef/CommonStructuredDataDef.h" #include "StructuredDataDef/CommonStructuredDataDef.h"
class StructuredDataDefDumperNew : AbstractTextDumper class StructuredDataDefDumper : AbstractTextDumper
{ {
struct struct
{ {
@ -21,7 +21,7 @@ class StructuredDataDefDumperNew : AbstractTextDumper
void DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, size_t structIndex); void DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, size_t structIndex);
public: public:
explicit StructuredDataDefDumperNew(std::ostream& stream); explicit StructuredDataDefDumper(std::ostream& stream);
void DumpDef(const CommonStructuredDataDef& def); void DumpDef(const CommonStructuredDataDef& def);
}; };