From 3394019790216360933090478665025216727891 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 11 Apr 2024 15:54:34 -0400 Subject: Rename lineWidth -> paddingCols in GetTypeLines() This is a more accurate name for what the parameter actually does. Documentation was improved as well. --- typeprinter.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'typeprinter.cpp') diff --git a/typeprinter.cpp b/typeprinter.cpp index 036c7c18..3b36da9d 100644 --- a/typeprinter.cpp +++ b/typeprinter.cpp @@ -102,13 +102,13 @@ bool TypePrinter::GetTypeStringAfterNameCallback(void* ctxt, BNType* type, bool TypePrinter::GetTypeLinesCallback(void* ctxt, BNType* type, BNTypeContainer* types, - BNQualifiedName* name, int lineWidth, bool collapsed, + BNQualifiedName* name, int paddingCols, bool collapsed, BNTokenEscapingType escaping, BNTypeDefinitionLine** result, size_t* resultCount) { TypePrinter* printer = (TypePrinter*)ctxt; vector lines = printer->GetTypeLines( new Type(BNNewTypeReference(type)), TypeContainer(types), - QualifiedName::FromAPIObject(name), lineWidth, collapsed, escaping); + QualifiedName::FromAPIObject(name), paddingCols, collapsed, escaping); *resultCount = lines.size(); *result = TypeDefinitionLine::CreateTypeDefinitionLineList(lines); @@ -117,7 +117,7 @@ bool TypePrinter::GetTypeLinesCallback(void* ctxt, BNType* type, BNTypeContainer bool TypePrinter::PrintAllTypesCallback(void* ctxt, BNQualifiedName* names, BNType** types, size_t typeCount, - BNBinaryView* data, int lineWidth, BNTokenEscapingType escaping, char** result) + BNBinaryView* data, int paddingCols, BNTokenEscapingType escaping, char** result) { TypePrinter* printer = (TypePrinter*)ctxt; vector>> apiTypes; @@ -126,7 +126,7 @@ bool TypePrinter::PrintAllTypesCallback(void* ctxt, BNQualifiedName* names, BNTy apiTypes.push_back({QualifiedName::FromAPIObject(&names[i]), new Type(types[i])}); } - string resultStr = printer->PrintAllTypes(apiTypes, new BinaryView(data), lineWidth, escaping); + string resultStr = printer->PrintAllTypes(apiTypes, new BinaryView(data), paddingCols, escaping); *result = BNAllocString(resultStr.c_str()); return true; } @@ -265,18 +265,18 @@ std::string TypePrinter::GetTypeStringAfterName( std::string TypePrinter::PrintAllTypes( const std::vector>>& types, Ref data, - int lineWidth, + int paddingCols, BNTokenEscapingType escaping ) { - return DefaultPrintAllTypes(types, data, lineWidth, escaping); + return DefaultPrintAllTypes(types, data, paddingCols, escaping); } std::string TypePrinter::DefaultPrintAllTypes( const std::vector>>& types, Ref data, - int lineWidth, + int paddingCols, BNTokenEscapingType escaping ) { @@ -291,7 +291,7 @@ std::string TypePrinter::DefaultPrintAllTypes( char* resultStr; BNTypePrinterDefaultPrintAllTypes(m_object, apiNames, apiTypes, types.size(), data->GetObject(), - lineWidth, escaping, &resultStr); + paddingCols, escaping, &resultStr); for (size_t i = 0; i < types.size(); i ++) { @@ -433,7 +433,7 @@ std::string CoreTypePrinter::GetTypeStringAfterName(Ref type, Ref CoreTypePrinter::GetTypeLines(Ref type, - const TypeContainer& types, const QualifiedName& name, int lineWidth, + const TypeContainer& types, const QualifiedName& name, int paddingCols, bool collapsed, BNTokenEscapingType escaping) { BNTypeDefinitionLine* lines; @@ -442,7 +442,7 @@ std::vector CoreTypePrinter::GetTypeLines(Ref type, BNQualifiedName qname = name.GetAPIObject(); bool success = BNGetTypePrinterTypeLines(GetObject(), type->GetObject(), types.GetObject(), &qname, - lineWidth, collapsed, escaping, &lines, &lineCount); + paddingCols, collapsed, escaping, &lines, &lineCount); QualifiedName::FreeAPIObject(&qname); if (!success) @@ -464,7 +464,7 @@ std::vector CoreTypePrinter::GetTypeLines(Ref type, std::string CoreTypePrinter::PrintAllTypes( const std::vector>>& types, Ref data, - int lineWidth, + int paddingCols, BNTokenEscapingType escaping ) { @@ -479,7 +479,7 @@ std::string CoreTypePrinter::PrintAllTypes( char* resultStr; BNTypePrinterPrintAllTypes(m_object, apiNames, apiTypes, types.size(), data->GetObject(), - lineWidth, escaping, &resultStr); + paddingCols, escaping, &resultStr); for (size_t i = 0; i < types.size(); i ++) { -- cgit v1.3.1