本文整理汇总了C#中IO.WritePointer方法的典型用法代码示例。如果您正苦于以下问题:C# IO.WritePointer方法的具体用法?C# IO.WritePointer怎么用?C# IO.WritePointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO
的用法示例。
在下文中一共展示了IO.WritePointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(IO.EndianWriter stream)
{
int orgPos = stream.Position;
if (address != 0)
{
if (offsets.Count == 0)
{
string name = (stream.Owner as Compiler).GetLocationName(this);
Debug.LogFile.WriteLine("LocationWriteback: unused address! There are no references to '{0}'", name);
}
else foreach (uint tempPos in offsets)
{
stream.PositionUnsigned = tempPos;
stream.WritePointer(address);
}
}
else
{
string name = (stream.Owner as Compiler).GetLocationName(this);
Debug.LogFile.WriteLine("LocationWriteback: failed to writeback! '{0}'s address was not set, {1} memory locations will be null!",
name, offsets.Count.ToString());
}
stream.Position = orgPos;
}
示例2: Write
public override void Write(IO.EndianWriter stream)
{
Compiler comp = stream.Owner as Compiler;
uint elementsAddress = 0;
int flags = (
(tagRef.IsNonResolving ? 1<<1 : 0)
);
if (tagRef.Elements.Count > 1)
{
elementsAddress = stream.PositionUnsigned;
foreach (string i in tagRef.Elements)
stream.WriteTag(i);
comp.MarkLocationFixup(tagRef.Name, stream, true);
stream.Write(flags);
stream.Write((int)-1);
stream.WritePointer(elementsAddress);
}
else
{
comp.MarkLocationFixup(tagRef.Name, stream, true);
stream.Write(flags);
stream.WriteTag(tagRef.Elements[0]);
stream.Write((int)0);
}
}
示例3: Write
public void Write(IO.EndianWriter stream)
{
Compiler comp = stream.Owner as Compiler;
Import import = comp.OwnerState.Importer as Import;
int real_count = import.Groups.Count;
stream.Write("dynamic tag groups", false);
stream.Write((short)DataArray.MaxValue);
stream.Write((short)Item.Size);
stream.Write(true);
stream.Write(true);
stream.Write((short)0);
MiscGroups.data.Write(stream);
stream.Write((short)real_count);//stream.Write((short)Datums.Count);
stream.Write((short)real_count);//stream.Write((short)Datums.Count);
stream.Write(real_count);
stream.WritePointer(stream.PositionUnsigned + 4);
#region Write tag group datums
foreach (Import.TagGroup tg in import.Groups.Values)
{
stream.Write((short)0); // Header
stream.Write((short)0); // Flags
comp.AddLocationFixup(tg.Name, stream, false);
stream.Write((int)0);
}
#endregion
#region Write null datums
Item i = new Item();
int count = DataArray.MaxValue - real_count;
for (int x = 0; x < count; x++)
i.Write(stream);
#endregion
}
示例4: Write
public void Write(IO.EndianWriter stream)
{
Compiler comp = stream.Owner as Compiler;
Import import = comp.OwnerState.Importer as Import;
short real_count = (short)import.Groups.Count;
var next_index = new DatumIndex((ushort)real_count,
0); // note that this default value isn't ideal
stream.Write("dynamic tag groups", false);
stream.Write(DataArray.MaxValue);
stream.Write(Item.Size);
stream.Write((byte)0); // alignment bit
stream.Write(true); // is valid
stream.Write((short)0); // flags
MiscGroups.data.Write(stream);
stream.Write(uint.MinValue); // allocator
stream.Write((int)0); // bit vector next index
stream.Write(Datums.Count); // bit vector length
stream.Write(Datums.Count); // actual count
next_index.Write(stream); // next index
stream.WritePointer(stream.PositionUnsigned + 8);
stream.Write((int)0); // bit vector pointer
#region Write tag group datums
foreach (Import.TagGroup tg in import.Groups.Values)
{
stream.Write((short)0); // Header
stream.Write((short)0); // Flags
comp.AddLocationFixup(tg.Name, stream, false);
stream.Write((int)0);
}
#endregion
#region Write null datums
Item i = new Item();
int count = DataArray.MaxValue - real_count;
for (int x = 0; x < count; x++)
i.Write(stream);
#endregion
}