public static Text Create(Pointer pointer, char[] value, int offset = 0, int count = -1) { if (value == null) { return(default(Text)); } if (count < 0) { count = value.Length - offset; } if (offset + count > value.Length) { throw new ArgumentOutOfRangeException("count"); } if (value.Length == 0) { // automatic nil pointer return((Text)pointer.AllocateList(ElementSize.OneByte, 1)); } int byteLen = Textizer.Encoding.GetByteCount(value, offset, count); var ptr = pointer.AllocateList(ElementSize.OneByte, byteLen + 1); Textizer.Write(ptr, value, offset, count); return((Text)ptr); }
protected Pointer CreateListImpl(Pointer pointer, int count) { if (elementSize == ElementSize.InlineComposite) { return(pointer.AllocateList(dataWords, pointers, count)); } else { return(pointer.AllocateList(elementSize, count)); } }
public static Text Create(Pointer pointer, string value) { if (value == null) { return(default(Text)); } if (value.Length == 0) { // automatic nil pointer return((Text)pointer.AllocateList(ElementSize.OneByte, 1)); } int byteLen = Textizer.Encoding.GetByteCount(value); var ptr = pointer.AllocateList(ElementSize.OneByte, byteLen + 1); ptr.WriteString(value); return(new Text(ptr, value)); }
public override FixedSizeList <FixedSizeList <TInner> > CreateList(Pointer pointer, int count) { return((FixedSizeList <FixedSizeList <TInner> >)pointer.AllocateList(ElementSize.EightBytesPointer, count)); }
public override FixedSizeList <double> CreateList(Pointer pointer, int count) { return((FixedSizeList <double>)pointer.AllocateList(ElementSize.EightBytesNonPointer, count)); }
public override FixedSizeList <float> CreateList(Pointer pointer, int count) { return((FixedSizeList <float>)pointer.AllocateList(ElementSize.FourBytes, count)); }
public override FixedSizeList <ushort> CreateList(Pointer pointer, int count) { return((FixedSizeList <ushort>)pointer.AllocateList(ElementSize.TwoBytes, count)); }
public override FixedSizeList <sbyte> CreateList(Pointer pointer, int count) { return((FixedSizeList <sbyte>)pointer.AllocateList(ElementSize.OneByte, count)); }
public override FixedSizeList <bool> CreateList(Pointer pointer, int count) { return((FixedSizeList <bool>)pointer.AllocateList(ElementSize.OneBit, count)); }
public static Data Create(Pointer parent, int length) { return((Data)parent.AllocateList(ElementSize.OneByte, length)); }
public static Data Create(Pointer parent, int length) { return (Data)parent.AllocateList(ElementSize.OneByte, length); }