Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/WinDepends/CConsts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public static class CConsts
public const int TagResolveAPIsets = 123;
public const int TagUpperCaseModuleNames = 124;
public const int TagClearLogOnFileOpen = 125;
public const int TagSimplifyStlNames = 126;
public const int TagViewExternalViewer = 200;
public const int TagViewProperties = 201;
public const int TagSystemInformation = 300;
Expand Down
3 changes: 3 additions & 0 deletions src/WinDepends/Configuration/CConfigMgr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class CConfiguration
[DataMember]
public bool ViewUndecorated { get; set; }
[DataMember]
public bool SimplifyStlNames { get; set; }
[DataMember]
public bool ResolveAPIsets { get; set; }
[DataMember]
public bool FullPaths { get; set; }
Expand Down Expand Up @@ -163,6 +165,7 @@ public CConfiguration(CConfiguration other)
SortColumnModules = other.SortColumnModules;
ModuleNodeDepthMax = other.ModuleNodeDepthMax;
ViewUndecorated = other.ViewUndecorated;
SimplifyStlNames = other.SimplifyStlNames;
ResolveAPIsets = other.ResolveAPIsets;
FullPaths = other.FullPaths;
AutoExpands = other.AutoExpands;
Expand Down
17 changes: 16 additions & 1 deletion src/WinDepends/Forms/ConfigurationForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/WinDepends/Forms/ConfigurationForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ private void ConfigurationForm_Load(object sender, EventArgs e)
chBoxAutoExpands.Checked = _config.AutoExpands;
chBoxFullPaths.Checked = _config.FullPaths;
chBoxUndecorateSymbols.Checked = _config.ViewUndecorated;
chBoxSimplifyStlNames.Checked = _config.SimplifyStlNames;
chBoxResolveApiSets.Checked = _config.ResolveAPIsets;
chBoxHighlightApiSet.Checked = _config.HighlightApiSet;
chBoxApiSetNamespace.Checked = _config.UseApiSetSchemaFile;
Expand Down Expand Up @@ -506,6 +507,10 @@ private void ChBox_Click(object sender, EventArgs e)
_config.ViewUndecorated = isChecked;
break;

case CConsts.TagSimplifyStlNames:
_config.SimplifyStlNames = isChecked;
break;

case CConsts.TagResolveAPIsets:
_config.ResolveAPIsets = isChecked;
break;
Expand Down
41 changes: 40 additions & 1 deletion src/WinDepends/MainForm/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public MainForm()
_configuration.SymbolsStorePath = _symbolResolver.StorePath;
}

_symbolResolver.SimplifyTemplateDefaults = _configuration.SimplifyStlNames;
_symbolResolver.SymbolLoadStatusChanged += SymbolResolver_SymbolLoadStatusChanged;

//
Expand Down Expand Up @@ -793,6 +794,7 @@ private void ShowConfigurationForm(int pageIndex)
var bFullPathPrev = _configuration.FullPaths;
var bUpperCaseModulesNamesPrev = _configuration.UpperCaseModuleNames;
var bUndecoratedPrev = _configuration.ViewUndecorated;
var bSimplifyStlPrev = _configuration.SimplifyStlNames;
var bResolveAPISetsPrev = _configuration.ResolveAPIsets;
var bHighlightAPISetsPrev = _configuration.HighlightApiSet;
var bUseApiSetSchemaFilePrev = _configuration.UseApiSetSchemaFile;
Expand Down Expand Up @@ -837,7 +839,18 @@ private void ShowConfigurationForm(int pageIndex)
UpdateFileView(FileViewUpdateAction.ModulesTreeAndListChange);
}

if (_configuration.ViewUndecorated != bUndecoratedPrev)
if (_configuration.SimplifyStlNames != bSimplifyStlPrev)
{
//
// The simplified spelling is baked into the cached undecorated
// name, so drop the cache to force re-decoration on next view.
//
_symbolResolver.SimplifyTemplateDefaults = _configuration.SimplifyStlNames;
ClearUndecoratedNameCache();
}

if (_configuration.ViewUndecorated != bUndecoratedPrev ||
_configuration.SimplifyStlNames != bSimplifyStlPrev)
{
UpdateFileView(FileViewUpdateAction.FunctionsUndecorateChange);
}
Expand Down Expand Up @@ -1490,6 +1503,32 @@ private void MenuExitItem_Click(object sender, EventArgs e)
Close();
}

/// <summary>
/// Clears cached undecorated names across all loaded modules so they are
/// recomputed with the current decoration / STL-simplification settings.
/// </summary>
private void ClearUndecoratedNameCache()
{
foreach (CModule module in _loadedModulesList)
{
if (module.ModuleData?.Exports is { } exports)
{
foreach (CFunction function in exports)
{
function.UndecoratedName = string.Empty;
}
}

if (module.ParentImports is { } imports)
{
foreach (CFunction function in imports)
{
function.UndecoratedName = string.Empty;
}
}
}
}

private void CopyFunctionNamesToClipboard(ListView listView, List<CFunction> functions)
{
var textBuilder = new StringBuilder();
Expand Down
Loading
Loading