亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? transform.cs

?? 詳細講述了數據庫編程
?? CS
字號:
#region Copyright & License
//
// Copyright 2001-2006 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

using System;
using System.Text;
using System.Xml;
using System.Text.RegularExpressions;

namespace log4net.Util
{
	/// <summary>
	/// Utility class for transforming strings.
	/// </summary>
	/// <remarks>
	/// <para>
	/// Utility class for transforming strings.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public sealed class Transform
	{
		#region Private Instance Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="Transform" /> class. 
		/// </summary>
		/// <remarks>
		/// <para>
		/// Uses a private access modifier to prevent instantiation of this class.
		/// </para>
		/// </remarks>
		private Transform()
		{
		}

		#endregion Private Instance Constructors

		#region XML String Methods

		/// <summary>
		/// Write a string to an <see cref="XmlWriter"/>
		/// </summary>
		/// <param name="writer">the writer to write to</param>
		/// <param name="textData">the string to write</param>
		/// <param name="invalidCharReplacement">The string to replace non XML compliant chars with</param>
		/// <remarks>
		/// <para>
		/// The test is escaped either using XML escape entities
		/// or using CDATA sections.
		/// </para>
		/// </remarks>
		public static void WriteEscapedXmlString(XmlWriter writer, string textData, string invalidCharReplacement)
		{
			string stringData = MaskXmlInvalidCharacters(textData, invalidCharReplacement);
			// Write either escaped text or CDATA sections

			int weightCData = 12 * (1 + CountSubstrings(stringData, CDATA_END));
			int weightStringEscapes = 3*(CountSubstrings(stringData, "<") + CountSubstrings(stringData, ">")) + 4*CountSubstrings(stringData, "&");

			if (weightStringEscapes <= weightCData)
			{
				// Write string using string escapes
				writer.WriteString(stringData);
			}
			else
			{
				// Write string using CDATA section

				int end = stringData.IndexOf(CDATA_END);
	
				if (end < 0) 
				{
					writer.WriteCData(stringData);
				}
				else
				{
					int start = 0;
					while (end > -1) 
					{
						writer.WriteCData(stringData.Substring(start, end - start));
						if (end == stringData.Length - 3)
						{
							start = stringData.Length;
							writer.WriteString(CDATA_END);
							break;
						}
						else
						{
							writer.WriteString(CDATA_UNESCAPABLE_TOKEN);
							start = end + 2;
							end = stringData.IndexOf(CDATA_END, start);
						}
					}
	
					if (start < stringData.Length)
					{
						writer.WriteCData(stringData.Substring(start));
					}
				}
			}
		}

		/// <summary>
		/// Replace invalid XML characters in text string
		/// </summary>
		/// <param name="textData">the XML text input string</param>
		/// <param name="mask">the string to use in place of invalid characters</param>
		/// <returns>A string that does not contain invalid XML characters.</returns>
		/// <remarks>
		/// <para>
		/// Certain Unicode code points are not allowed in the XML InfoSet, for
		/// details see: <a href="http://www.w3.org/TR/REC-xml/#charsets">http://www.w3.org/TR/REC-xml/#charsets</a>.
		/// </para>
		/// <para>
		/// This method replaces any illegal characters in the input string
		/// with the mask string specified.
		/// </para>
		/// </remarks>
		public static string MaskXmlInvalidCharacters(string textData, string mask)
		{
			return INVALIDCHARS.Replace(textData, mask);
		}

		#endregion XML String Methods

		#region Private Helper Methods

		/// <summary>
		/// Count the number of times that the substring occurs in the text
		/// </summary>
		/// <param name="text">the text to search</param>
		/// <param name="substring">the substring to find</param>
		/// <returns>the number of times the substring occurs in the text</returns>
		/// <remarks>
		/// <para>
		/// The substring is assumed to be non repeating within itself.
		/// </para>
		/// </remarks>
		private static int CountSubstrings(string text, string substring)
		{
			int count = 0;
			int offset = 0;
			int length = text.Length;
			int substringLength = substring.Length;

			if (length == 0)
			{
				return 0;
			}
			if (substringLength == 0)
			{
				return 0;
			}

			while(offset < length)
			{
				int index = text.IndexOf(substring, offset);

				if (index == -1)
				{
					break;
				}

				count++;
				offset = index + substringLength;
			}
			return count;
		}

		#endregion

		#region Private Static Fields

		private const string CDATA_END	= "]]>";
		private const string CDATA_UNESCAPABLE_TOKEN	= "]]";

		private static Regex INVALIDCHARS=new Regex(@"[^\x09\x0A\x0D\x20-\xFF\u00FF-\u07FF\uE000-\uFFFD]",RegexOptions.Compiled);
		#endregion Private Static Fields
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线免费视屏| 夜夜嗨av一区二区三区| 久久不见久久见中文字幕免费| 欧美日韩性生活| 日本午夜精品视频在线观看| 欧美一区二区视频在线观看2022| 视频一区中文字幕国产| 538prom精品视频线放| 欧美a级一区二区| 久久久久久99精品| 99久久精品国产毛片| 夜夜精品视频一区二区| 91精品国产综合久久小美女| 久久狠狠亚洲综合| 中文字幕一区在线观看视频| 91久久香蕉国产日韩欧美9色| 五月婷婷激情综合网| 精品久久久久av影院| 成人高清免费在线播放| 亚洲高清中文字幕| 欧美精品一区二区三区很污很色的| 粉嫩av一区二区三区在线播放 | 蜜臀av性久久久久蜜臀aⅴ流畅 | 一区二区高清在线| 欧美电视剧免费全集观看| 国产精品自拍三区| 亚洲视频在线一区观看| 欧美一级一级性生活免费录像| 国产毛片精品视频| 亚洲另类在线一区| 精品久久人人做人人爱| 91蜜桃在线免费视频| 老司机精品视频线观看86| 日韩一区欧美小说| 精品免费99久久| 色综合天天综合色综合av | 日韩黄色小视频| 国产精品热久久久久夜色精品三区 | 国产在线日韩欧美| 亚洲毛片av在线| 久久夜色精品国产欧美乱极品| 色婷婷av一区二区| 国产麻豆成人传媒免费观看| 夜夜嗨av一区二区三区网页| 久久精品男人的天堂| 欧美裸体bbwbbwbbw| av一区二区不卡| 国产一区二区三区国产| 首页亚洲欧美制服丝腿| 一区在线观看免费| 337p粉嫩大胆噜噜噜噜噜91av| 在线看不卡av| 99久久777色| 国产999精品久久久久久绿帽| 日韩高清不卡在线| 一级做a爱片久久| 中文字幕一区二区视频| 久久久.com| 欧美精品一区二区三区久久久| 777亚洲妇女| 欧美在线小视频| 一本一道波多野结衣一区二区| 成人午夜av影视| 国产成人一区二区精品非洲| 裸体歌舞表演一区二区| 五月天一区二区| 同产精品九九九| 亚洲成人黄色影院| 又紧又大又爽精品一区二区| 亚洲伦在线观看| 亚洲欧美一区二区视频| 中文字幕一区二区三区在线不卡| 国产欧美一区二区精品婷婷| 亚洲精品在线观| 欧美本精品男人aⅴ天堂| 欧美一二三在线| 欧美一区二区三区公司| 欧美一二三四在线| 日韩欧美自拍偷拍| 精品久久免费看| 国产亚洲成av人在线观看导航| 久久女同性恋中文字幕| 久久综合九色欧美综合狠狠| 久久精品日韩一区二区三区| 久久这里只有精品6| 国产亚洲欧美一区在线观看| 国产精品视频在线看| 最新久久zyz资源站| 亚洲另类色综合网站| 性做久久久久久免费观看欧美| 亚洲国产精品久久人人爱蜜臀 | 久久久噜噜噜久久中文字幕色伊伊 | 欧美在线免费观看视频| 欧美午夜精品一区二区蜜桃| 欧美精品丝袜久久久中文字幕| 欧美一区二区美女| 欧美不卡视频一区| 国产欧美va欧美不卡在线| 国产精品久久久久精k8 | 欧美高清精品3d| 91麻豆精品国产自产在线观看一区| 欧美日韩国产bt| 精品国免费一区二区三区| 久久青草国产手机看片福利盒子| 日本一区二区三区四区在线视频 | 国产精品嫩草99a| 亚洲自拍与偷拍| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品性做久久久久久| 99re这里只有精品视频首页| 欧美高清视频www夜色资源网| 精品国产电影一区二区| 亚洲色图视频网站| 日本伊人色综合网| 成人一区二区三区视频 | 一本一道久久a久久精品综合蜜臀| 欧美日韩免费一区二区三区| 久久久亚洲精品一区二区三区| 亚洲日本在线a| 麻豆免费精品视频| 99久久国产综合精品女不卡| 欧美一级久久久| 亚洲精品午夜久久久| 激情小说欧美图片| 在线中文字幕一区| 国产亚洲欧美日韩在线一区| 一区二区久久久| 国产成a人亚洲| 在线电影院国产精品| 中文字幕第一区第二区| 久久精品国内一区二区三区| 99国产精品久久久久久久久久| 精品三级av在线| 亚洲自拍偷拍网站| 成人免费毛片高清视频| 欧美一级一级性生活免费录像| 亚洲视频电影在线| 国产福利一区二区三区| 欧美一区二区精品在线| 亚洲欧美日韩国产综合在线| 韩国三级在线一区| 在线电影院国产精品| 亚洲人成网站在线| 国产成人在线色| 精品1区2区在线观看| 偷窥少妇高潮呻吟av久久免费| 95精品视频在线| 欧美国产国产综合| 国产在线麻豆精品观看| 精品奇米国产一区二区三区| 亚洲成人av免费| 欧美综合在线视频| 亚洲女同一区二区| 成人一区在线看| 中文乱码免费一区二区| 国内一区二区视频| 欧美变态口味重另类| 美女视频黄免费的久久| 精品视频一区三区九区| 亚洲高清中文字幕| 欧美日韩精品久久久| 一区二区三区精品视频在线| 色香色香欲天天天影视综合网| 国产精品国产精品国产专区不蜜| 国产馆精品极品| 久久精品免费在线观看| 国产精品18久久久久久久久| 久久影院午夜片一区| 日韩成人午夜电影| 日韩一区二区免费在线观看| 麻豆专区一区二区三区四区五区| 在线观看91av| 男女男精品视频| 久久亚洲私人国产精品va媚药| 男男gaygay亚洲| 2024国产精品视频| 国产91精品一区二区麻豆亚洲| 国产亚洲va综合人人澡精品| 国产成人高清在线| 中文字幕 久热精品 视频在线 | 亚洲电影一区二区三区| 欧美精品久久天天躁| 蜜桃久久久久久| 国产亚洲短视频| 91久久国产最好的精华液| 亚洲国产一区二区三区青草影视| 欧美三区在线观看| 久久精品国产成人一区二区三区| 久久亚洲春色中文字幕久久久| 成人免费三级在线| 亚洲综合色成人| 欧美r级在线观看| caoporen国产精品视频| 亚洲国产欧美一区二区三区丁香婷| 欧美美女黄视频| 国产伦精一区二区三区| 亚洲精品乱码久久久久| 91精品国产综合久久精品| 国产伦精一区二区三区| 亚洲免费在线视频|