本文整理汇总了C#中IO.ReadCString方法的典型用法代码示例。如果您正苦于以下问题:C# IO.ReadCString方法的具体用法?C# IO.ReadCString怎么用?C# IO.ReadCString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO
的用法示例。
在下文中一共展示了IO.ReadCString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadTagInstances
protected override void ReadTagInstances(IO.EndianReader s, Blam.CacheFile cache)
{
// Read the tag index items
items = new CacheItem[tagCount];
for (int x = 0; x < tagCount; x++)
(items[x] = new CacheItem()).Read(s);
// Read the tag filename strings
foreach (Stubbs.CacheItem ci in items)
ci.ReferenceName = cache.References.AddOptimized(ci.GroupTag, s.ReadCString());
}
示例2: Read
/// <summary>
/// Stream the field from a buffer
/// </summary>
/// <param name="input"></param>
public override void Read(IO.EndianReader input)
{
if (StringType == StringType.Normal) Value = input.ReadTagString();
else if (StringType == StringType.Unicode) Value = input.ReadUnicodeString(Length);
else if (StringType == StringType.Ascii) Value = input.ReadAsciiString(Length);
else if (StringType == StringType.Halo1Profile) Value = input.ReadUnicodeString(12);
else if (StringType == StringType.Halo2Profile) Value = input.ReadUnicodeString(16);
else if (StringType == StringType.CString) Value = input.ReadCString();
}
示例3: Read
public override void Read(IO.EndianReader s)
{
BlamVersion ver = (BlamVersion)s.ReadUInt16();
// HACK: this is a hack
if (ver == BlamVersion.Halo1)
ver = BlamVersion.Halo1_CE;
Debug.Assert.If(ver == engine, "Engine version mismatch: expected {0}, but got {1}", engine, ver);
s.Seek(2, System.IO.SeekOrigin.Current);
#region FileNames
int file_count = s.ReadInt32();
for (int x = 0; x < file_count; x++) files.Add(s.ReadCString());
#endregion
}
示例4: FixupTagInstanceHeaderName
static void FixupTagInstanceHeaderName(CacheFile cache, CacheItem instance, int name_offset, IO.EndianReader s)
{
s.Seek(name_offset);
instance.TagNameOffset = s.PositionUnsigned;
instance.ReferenceName = cache.References.AddOptimized(instance.GroupTag, s.ReadCString());
}