public void Visit(uint offset, TagBlockGuess guess)
 {
     var name = string.Format("Tag Block {0}", _nextTagBlock);
     _nextTagBlock++;
     var elementLayout = new TagLayout(name, guess.ElementLayout.Size, new Tag(0));
     var finalizer = new LayoutGuessFinalizer(elementLayout, _nextTagBlock);
     finalizer.ProcessLayout(guess.ElementLayout);
     var align = guess.Align;
     if ((guess.ElementLayout.Size & (guess.Align - 1)) != 0)
         align = 0;
     _nextTagBlock = finalizer._nextTagBlock;
     _result.Add(new TagBlockTagLayoutField(MakeName(offset), elementLayout) { DataAlign = align });
 }
            void ITagElementGuessVisitor.Visit(uint offset, TagBlockGuess guess)
            {
                var className = string.Format("TagBlock{0}", _nextUnknownBlock++);

                using (var blockWriter = new StringWriter())
                {
                    var blockBuilder = new ClassBuilder(blockWriter, _indentLevel, className);
                    blockBuilder._nextUnknownBlock = _nextUnknownBlock;
                    LayoutGuessWriter.Write(null, guess.ElementLayout, blockBuilder);
                    _subBlocks.Enqueue(blockWriter.ToString());
                    _nextUnknownBlock = blockBuilder._nextUnknownBlock;
                }
                AddUnknown(offset, string.Format("List<{0}>", className));
            }
        public void Visit(uint offset, TagBlockGuess guess)
        {
            var name = string.Format("Tag Block {0}", _nextTagBlock);

            _nextTagBlock++;
            var elementLayout = new TagLayout(name, guess.ElementLayout.Size, new Tag(0));
            var finalizer     = new LayoutGuessFinalizer(elementLayout, _nextTagBlock);

            finalizer.ProcessLayout(guess.ElementLayout);
            var align = guess.Align;

            if ((guess.ElementLayout.Size & (guess.Align - 1)) != 0)
            {
                align = 0;
            }
            _nextTagBlock = finalizer._nextTagBlock;
            _result.Add(new TagBlockTagLayoutField(MakeName(offset), elementLayout)
            {
                DataAlign = align
            });
        }
예제 #4
0
 void ITagElementGuessVisitor.Visit(uint offset, TagBlockGuess guess)
 {
     var structName = string.Format("TagBlock{0}", _nextUnknownBlock++);
     _writer.WriteLine("{0}struct {1};", _indent, structName);
     using (var blockWriter = new StringWriter())
     {
         var blockBuilder = new StructBuilder(blockWriter, _indentLevel, structName);
         blockBuilder._nextUnknownBlock = _nextUnknownBlock;
         LayoutGuessWriter.Write(null, guess.ElementLayout, blockBuilder);
         _subBlocks.Enqueue(blockWriter.ToString());
         _nextUnknownBlock = blockBuilder._nextUnknownBlock;
     }
     AddUnknown(offset, string.Format("TagBlock<{0}>", structName));
 }