Example #1
1
 public ListStack(NonListStackData data, ListStack formerStack)
     : base(formerStack.OutStream)
 {
     _data = new NonListStackData[formerStack._data.Length + 1];
     _data[0] = data;
     formerStack._data.CopyTo(_data, 1);
 }
Example #2
0
 ListStack(NonListStackData[] data, NonListStackData formerStackData)
     : base(formerStackData.OutStream)
 {
     _data = new NonListStackData[data.Length + 1];
     data.CopyTo(_data, 0);
     _data[data.Length] = formerStackData;
 }
Example #3
0
 ListStack(NonListStackData[] data, ListStack formerStack)
     : base(formerStack.OutStream)
 {
     _data = new NonListStackData[data.Length + formerStack._data.Length];
     data.CopyTo(_data, 0);
     formerStack._data.CopyTo(_data, data.Length);
 }
Example #4
0
 internal override StackData PushOnto(NonListStackData formerStack)
     => new ListStack(this, formerStack);
Example #5
0
 ListStack(NonListStackData[] data, IOutStream outStream)
     : base(outStream)
 {
     _data = data;
 }
Example #6
0
 DataStack.DataMemento GetItemMemento(NonListStackData item, int index)
 {
     return new DataStack.DataMemento(item.Dump())
     {
         Size = item.Size.ToInt(),
         Offset = _data.Skip(index).Sum(item1 => item1.Size.ToInt())
     };
 }
Example #7
0
 string DumpItem(NonListStackData item, int index)
 {
     var offset = _data.Skip(index).Sum(item1 => item1.Size.ToInt());
     return "[" + index + "]-" + offset + ": " + item.Dump();
 }
Example #8
0
 public ListStack(NonListStackData top, NonListStackData formerStackData)
     : base(top.OutStream)
 {
     _data = new[] {top, formerStackData};
 }
Example #9
0
 static BitsConst Paste(BitsConst bitsConst, NonListStackData data)
     => bitsConst.Concat(data.GetBitsConst());
Example #10
0
 StackData SubString(int start, int length)
 {
     switch(length)
     {
         case 0:
             return new EmptyStackData(OutStream);
         case 1:
             return _data[start];
         default:
         {
             var newData = new NonListStackData[length];
             for(var i = 0; i < length; i++)
                 newData[i] = _data[start + i];
             return new ListStack(newData, OutStream);
         }
     }
 }
Example #11
0
 internal override StackData PushOnto(NonListStackData formerStack) => formerStack;
Example #12
0
 internal virtual StackData PushOnto(NonListStackData formerStack)
 {
     NotImplementedMethod(formerStack);
     return null;
 }