当前位置: 首页>>代码示例>>C#>>正文


C# IWriter.WriteUTF8方法代码示例

本文整理汇总了C#中IWriter.WriteUTF8方法的典型用法代码示例。如果您正苦于以下问题:C# IWriter.WriteUTF8方法的具体用法?C# IWriter.WriteUTF8怎么用?C# IWriter.WriteUTF8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IWriter的用法示例。


在下文中一共展示了IWriter.WriteUTF8方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteLocaleChanges

        private static void WriteLocaleChanges(Patch patch, IWriter writer)
        {
            if (patch.LanguageChanges.Count == 0)
                return;

            long startPos = writer.Position;
            writer.WriteInt32(AssemblyPatchBlockID.Locl);
            writer.WriteUInt32(0); // Size filled in later
            writer.WriteByte(0); // Version 0

            // Write change data for each language
            writer.WriteByte((byte)patch.LanguageChanges.Count);
            foreach (LanguageChange language in patch.LanguageChanges)
            {
                writer.WriteByte(language.LanguageIndex);

                // Write the change data for each string in the language
                writer.WriteInt32(language.LocaleChanges.Count);
                foreach (LocaleChange change in language.LocaleChanges)
                {
                    writer.WriteUInt16((ushort)change.Index);
                    writer.WriteUTF8(change.NewValue);
                }
            }

            // Fill in the block size
            long endPos = writer.Position;
            writer.SeekTo(startPos + 4);
            writer.WriteUInt32((uint)(endPos - startPos));
            writer.SeekTo(endPos);
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:31,代码来源:AssemblyPatchWriter.cs

示例2: WriteLocaleChanges

		private static void WriteLocaleChanges(Patch patch, ContainerWriter container, IWriter writer)
		{
			if (patch.LanguageChanges.Count == 0)
				return;

			container.StartBlock("locl", 0); // Version 0

			// Write change data for each language
			writer.WriteByte((byte) patch.LanguageChanges.Count);
			foreach (LanguageChange language in patch.LanguageChanges)
			{
				writer.WriteByte(language.LanguageIndex);

				// Write the change data for each string in the language
				writer.WriteInt32(language.LocaleChanges.Count);
				foreach (LocaleChange change in language.LocaleChanges)
				{
					writer.WriteInt32(change.Index);
					writer.WriteUTF8(change.NewValue);
				}
			}

			container.EndBlock();
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:24,代码来源:AssemblyPatchWriter.cs

示例3: WriteLocaleChanges

        private static void WriteLocaleChanges(Patch patch, IWriter writer)
        {
            if (patch.LanguageChanges.Count == 0)
                return;

            var startPos = WriteBlockHeader(writer, AssemblyPatchBlockID.Locl);
            writer.WriteByte(0); // Version 0

            // Write change data for each language
            writer.WriteByte((byte)patch.LanguageChanges.Count);
            foreach (var language in patch.LanguageChanges)
            {
                writer.WriteByte(language.LanguageIndex);

                // Write the change data for each string in the language
                writer.WriteInt32(language.LocaleChanges.Count);
                foreach (var change in language.LocaleChanges)
                {
                    writer.WriteInt32(change.Index);
                    writer.WriteUTF8(change.NewValue);
                }
            }

            EndBlock(writer, startPos);
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:25,代码来源:AssemblyPatchWriter.cs

示例4: WriteDataBlocks

		private static void WriteDataBlocks(TagContainer tags, ContainerWriter container, IWriter writer)
		{
			foreach (DataBlock dataBlock in tags.DataBlocks)
			{
				container.StartBlock("data", 6);

				// Main data
				writer.WriteUInt32(dataBlock.OriginalAddress);
				writer.WriteInt32(dataBlock.EntryCount);
				writer.WriteInt32(dataBlock.Alignment);
				WriteByteArray(dataBlock.Data, writer);

				// Address fixups
				writer.WriteInt32(dataBlock.AddressFixups.Count);
				foreach (DataBlockAddressFixup blockRef in dataBlock.AddressFixups)
				{
					writer.WriteUInt32(blockRef.OriginalAddress);
					writer.WriteInt32(blockRef.WriteOffset);
				}

				// Tagref fixups
				writer.WriteInt32(dataBlock.TagFixups.Count);
				foreach (DataBlockTagFixup tagRef in dataBlock.TagFixups)
				{
					writer.WriteUInt32(tagRef.OriginalIndex.Value);
					writer.WriteInt32(tagRef.WriteOffset);
				}

				// Resource reference fixups
				writer.WriteInt32(dataBlock.ResourceFixups.Count);
				foreach (DataBlockResourceFixup resourceRef in dataBlock.ResourceFixups)
				{
					writer.WriteUInt32(resourceRef.OriginalIndex.Value);
					writer.WriteInt32(resourceRef.WriteOffset);
				}

				// StringID fixups
				writer.WriteInt32(dataBlock.StringIDFixups.Count);
				foreach (DataBlockStringIDFixup sid in dataBlock.StringIDFixups)
				{
					writer.WriteAscii(sid.OriginalString);
					writer.WriteInt32(sid.WriteOffset);
				}

				// Shader fixups
				writer.WriteInt32(dataBlock.ShaderFixups.Count);
				foreach (DataBlockShaderFixup shaderRef in dataBlock.ShaderFixups)
				{
					writer.WriteInt32(shaderRef.WriteOffset);
					if (shaderRef.Data != null)
					{
						writer.WriteInt32(shaderRef.Data.Length);
						writer.WriteBlock(shaderRef.Data);
					}
					else
					{
						writer.WriteInt32(0);
					}
				}

				// Unicode string list fixups
				writer.WriteInt32(dataBlock.UnicListFixups.Count);
				foreach (DataBlockUnicListFixup unicList in dataBlock.UnicListFixups)
				{
					writer.WriteInt32(unicList.LanguageIndex);
					writer.WriteInt32(unicList.WriteOffset);
					writer.WriteInt32(unicList.Strings.Length);
					foreach (UnicListFixupString str in unicList.Strings)
					{
						writer.WriteAscii(str.StringID);
						writer.WriteUTF8(str.String);
					}
				}

				container.EndBlock();
			}
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:77,代码来源:TagContainerWriter.cs


注:本文中的IWriter.WriteUTF8方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。