summaryrefslogtreecommitdiff
path: root/highlevelil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'highlevelil.cpp')
-rw-r--r--highlevelil.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/highlevelil.cpp b/highlevelil.cpp
index 89cf645f..10e2cd6a 100644
--- a/highlevelil.cpp
+++ b/highlevelil.cpp
@@ -648,6 +648,42 @@ HighLevelILTokenEmitter::HighLevelILTokenEmitter(BNHighLevelILTokenEmitter* emit
m_object = emitter;
}
+void HighLevelILTokenEmitter::PrependCollapseIndicator()
+{
+ BNHighLevelILTokenPrependCollapseBlankIndicator(m_object);
+}
+
+
+void HighLevelILTokenEmitter::PrependCollapseIndicator(Ref<Function> function, const HighLevelILInstruction& instr, uint64_t designator)
+{
+ if (!HasCollapsableRegions())
+ return;
+
+ // Insert the collapse indicator at the beginning of the line if one isn't already there or the
+ // one that is there is empty
+ auto context = HighLevelILInstruction::CanCollapse(instr.operation) ?
+ (function && function->IsInstructionCollapsed(instr, designator) ? ContentCollapsedContext : ContentExpandedContext) :
+ ContentCollapsiblePadding;
+
+ PrependCollapseIndicator(context, instr.GetInstructionHash(designator));
+}
+
+void HighLevelILTokenEmitter::PrependCollapseIndicator(BNInstructionTextTokenContext context, uint64_t hash)
+{
+ BNHighLevelILTokenPrependCollapseIndicator(m_object, context, hash);
+}
+
+bool HighLevelILTokenEmitter::HasCollapsableRegions()
+{
+ return BNHighLevelILTokenEmitterHasCollapsableRegions(m_object);
+}
+
+
+void HighLevelILTokenEmitter::SetHasCollapsableRegions(bool state)
+{
+ BNHighLevelILTokenEmitterSetHasCollapsableRegions(m_object, state);
+}
+
void HighLevelILTokenEmitter::NewLine()
{
@@ -908,4 +944,4 @@ void HighLevelILTokenEmitter::AddNamesForOuterStructureMembers(
newNames.push_back(names[i]);
BNFreeStringList(names, nameCount);
nameList.insert(nameList.begin(), newNames.begin(), newNames.end());
-}
+} \ No newline at end of file