// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. namespace WixToolset.Extensibility { using System.Xml.Linq; using WixToolset.Extensibility.Data; /// /// Interface for extending the WiX toolset preprocessor. /// public interface IPreprocessorExtension { /// /// Gets the variable prefixes for the extension. /// /// The variable prefixes for the extension. string[] Prefixes { get; } /// /// Called at the beginning of the preprocessing of a source file. /// void PrePreprocess(IPreprocessContext context); /// /// Gets the value of a variable whose prefix matches the extension. /// /// The prefix of the variable to be processed by the extension. /// The name of the variable. /// The value of the variable or null if the variable is undefined. string GetVariableValue(string prefix, string name); /// /// Evaluates a function defined in the extension. /// /// The prefix of the function to be processed by the extension. /// The name of the function. /// The list of arguments. /// The value of the function or null if the function is not defined. string EvaluateFunction(string prefix, string function, string[] args); /// /// Processes a pragma defined in the extension. /// /// The location of this pragma's PI. /// The prefix of the pragma to be processed by the extension. /// The name of the pragma. /// The pragma's arguments. /// The parent node of the pragma. /// false if the pragma is not defined. /// Don't return false for any condition except for unrecognized pragmas. Use Core.OnMessage for errors, warnings and messages. bool ProcessPragma(string prefix, string pragma, string args, XContainer parent); /// /// Called at the end of the preprocessing of a source file. /// void PostPreprocess(IPreprocessResult result); } }