// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; using Microsoft.Framework.Internal; namespace Microsoft.Framework.WebEncoders { /// /// Provides services for HTML-encoding input. /// public interface IHtmlEncoder { /// /// HTML-encodes a character array and writes the result to the supplied /// output. /// /// /// The encoded value is also appropriately encoded for inclusion inside an HTML attribute /// as long as the attribute value is surrounded by single or double quotes. /// void HtmlEncode([NotNull] char[] value, int startIndex, int charCount, [NotNull] TextWriter output); /// /// HTML-encodes a given input string. /// /// /// The HTML-encoded value, or null if the input string was null. /// /// /// The return value is also appropriately encoded for inclusion inside an HTML attribute /// as long as the attribute value is surrounded by single or double quotes. /// string HtmlEncode(string value); /// /// HTML-encodes a given input string and writes the result to the /// supplied output. /// /// /// The encoded value is also appropriately encoded for inclusion inside an HTML attribute /// as long as the attribute value is surrounded by single or double quotes. /// void HtmlEncode([NotNull] string value, int startIndex, int charCount, [NotNull] TextWriter output); } }