Add an extension method

This commit is contained in:
de4dot 2018-10-26 22:22:31 +02:00
parent fd9efb87ec
commit 54565c2945
2 changed files with 15 additions and 1 deletions

View File

@ -88,6 +88,20 @@ namespace Iced.Intel {
MemorySizeNever = (uint)MemorySizeOptions.Never << (int)MemorySizeShift, MemorySizeNever = (uint)MemorySizeOptions.Never << (int)MemorySizeShift,
} }
/// <summary>
/// Extension methods
/// </summary>
public static class FormatterOperandOptionsExtensions {
/// <summary>
/// Returns new options with a new <see cref="MemorySizeOptions"/> value
/// </summary>
/// <param name="self">Operand options</param>
/// <param name="options">Memory size options</param>
/// <returns></returns>
public static FormatterOperandOptions WithMemorySize(this FormatterOperandOptions self, MemorySizeOptions options) =>
(self & ~FormatterOperandOptions.MemorySizeMask) | (FormatterOperandOptions)((uint)options << (int)FormatterOperandOptions.MemorySizeShift);
}
/// <summary> /// <summary>
/// Gets initialized with the default options and can be overridden by a <see cref="IFormatterOptionsProvider"/> /// Gets initialized with the default options and can be overridden by a <see cref="IFormatterOptionsProvider"/>
/// </summary> /// </summary>

View File

@ -22,7 +22,7 @@ using System;
namespace Iced.Intel { namespace Iced.Intel {
/// <summary> /// <summary>
/// Used by a <see cref="Formatter"/> to resolve symbols. It can also override number formatting options /// Used by a <see cref="Formatter"/> to resolve symbols
/// </summary> /// </summary>
public interface ISymbolResolver { public interface ISymbolResolver {
/// <summary> /// <summary>