mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 09:07:55 -05:00
refactor: use new line character instead of std::endl
This commit is contained in:
@ -14,9 +14,7 @@ PrettyPrinter::PrettyPrinter(std::ostream& stream, const IDataRepository* reposi
|
||||
|
||||
void PrettyPrinter::PrintSeparator() const
|
||||
{
|
||||
m_stream << std::endl
|
||||
<< "==========================================================================================================" << std::endl
|
||||
<< std::endl;
|
||||
m_stream << "\n==========================================================================================================\n\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariablePointerToArray(Variable* variable) const
|
||||
@ -51,7 +49,7 @@ void PrettyPrinter::PrintVariablePointerToArray(Variable* variable) const
|
||||
m_stream << variable->m_name << ")";
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariableArrayOfPointers(Variable* variable) const
|
||||
@ -86,7 +84,7 @@ void PrettyPrinter::PrintVariableArrayOfPointers(Variable* variable) const
|
||||
m_stream << " " << variable->m_name;
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintVariable(Variable* variable) const
|
||||
@ -94,7 +92,7 @@ void PrettyPrinter::PrintVariable(Variable* variable) const
|
||||
const auto& declarationModifiers = variable->m_type_declaration->m_declaration_modifiers;
|
||||
if (declarationModifiers.empty())
|
||||
{
|
||||
std::cout << " " << variable->m_type_declaration->m_type->GetFullName() << " " << variable->m_name << std::endl;
|
||||
std::cout << " " << variable->m_type_declaration->m_type->GetFullName() << " " << variable->m_name << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -147,7 +145,7 @@ void PrettyPrinter::PrintTypedefPointerToArray(TypedefDefinition* typedefDefinit
|
||||
m_stream << typedefDefinition->m_name << ")";
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintTypedefArrayOfPointers(TypedefDefinition* typedefDefinition) const
|
||||
@ -182,84 +180,84 @@ void PrettyPrinter::PrintTypedefArrayOfPointers(TypedefDefinition* typedefDefini
|
||||
m_stream << " " << typedefDefinition->m_name;
|
||||
for (auto size : arraySize)
|
||||
m_stream << '[' << size << ']';
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintEnums() const
|
||||
{
|
||||
const auto& allEnums = m_repository->GetAllEnums();
|
||||
m_stream << allEnums.size() << " enums:" << std::endl;
|
||||
m_stream << allEnums.size() << " enums:\n";
|
||||
|
||||
for (auto* enumDefinition : allEnums)
|
||||
{
|
||||
m_stream << " Name: " << enumDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << enumDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << enumDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << enumDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << enumDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << enumDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& enumMember : enumDefinition->m_members)
|
||||
{
|
||||
m_stream << " " << enumMember->m_name << " = " << enumMember->m_value << std::endl;
|
||||
m_stream << " " << enumMember->m_name << " = " << enumMember->m_value << "\n";
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintStructs() const
|
||||
{
|
||||
const auto& allStructs = m_repository->GetAllStructs();
|
||||
m_stream << allStructs.size() << " structs:" << std::endl;
|
||||
m_stream << allStructs.size() << " structs:\n";
|
||||
|
||||
for (auto* structDefinition : allStructs)
|
||||
{
|
||||
m_stream << " Name: " << structDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << structDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << structDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << structDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << structDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << structDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& variable : structDefinition->m_members)
|
||||
{
|
||||
PrintVariable(variable.get());
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintUnions() const
|
||||
{
|
||||
const auto& allUnions = m_repository->GetAllUnions();
|
||||
m_stream << allUnions.size() << " unions:" << std::endl;
|
||||
m_stream << allUnions.size() << " unions:\n";
|
||||
|
||||
for (auto* unionDefinition : allUnions)
|
||||
{
|
||||
m_stream << " Name: " << unionDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << unionDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << unionDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << unionDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << unionDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << unionDefinition->GetSize() << "\n";
|
||||
|
||||
for (const auto& variable : unionDefinition->m_members)
|
||||
{
|
||||
PrintVariable(variable.get());
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void PrettyPrinter::PrintTypedefs() const
|
||||
{
|
||||
const auto& allTypedefs = m_repository->GetAllTypedefs();
|
||||
m_stream << allTypedefs.size() << " typedefs:" << std::endl;
|
||||
m_stream << allTypedefs.size() << " typedefs:\n";
|
||||
|
||||
for (auto* typedefDefinition : allTypedefs)
|
||||
{
|
||||
m_stream << " Name: " << typedefDefinition->GetFullName() << std::endl;
|
||||
m_stream << " Alignment: " << typedefDefinition->GetAlignment() << std::endl;
|
||||
m_stream << " Size: " << typedefDefinition->GetSize() << std::endl;
|
||||
m_stream << " Name: " << typedefDefinition->GetFullName() << "\n";
|
||||
m_stream << " Alignment: " << typedefDefinition->GetAlignment() << "\n";
|
||||
m_stream << " Size: " << typedefDefinition->GetSize() << "\n";
|
||||
|
||||
const auto& declarationModifiers = typedefDefinition->m_type_declaration->m_declaration_modifiers;
|
||||
if (declarationModifiers.empty())
|
||||
{
|
||||
std::cout << " " << typedefDefinition->m_type_declaration->m_type->GetFullName() << std::endl;
|
||||
std::cout << " " << typedefDefinition->m_type_declaration->m_type->GetFullName() << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -279,7 +277,7 @@ void PrettyPrinter::PrintTypedefs() const
|
||||
}
|
||||
}
|
||||
|
||||
m_stream << std::endl;
|
||||
m_stream << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user