internal Sample(NativeType _sample) { // Note: copies are made here. Could we avoid this ? this.ResName = ZTypes.ZStringToString(_sample.key); this.Payload = ZTypes.ZBytesToBytesArray(_sample.value); ZnSampleFree(_sample); }
unsafe internal Sample(IntPtr /* *const zn_sample_t */ _sample) { // Note: copies are made here. Could we avoid this ? NativeType *s = (NativeType *)_sample; this.ResName = ZTypes.ZStringToString(s->key); this.Payload = ZTypes.ZBytesToBytesArray(s->value); }
public Dictionary <string, string> Info() { var zstr = ZnInfoAsStr(this._nativePtr); var str = ZTypes.ZStringToString(zstr); // Parse the properties from the string var properties = str.Split(_propSeparator, StringSplitOptions.RemoveEmptyEntries) .Select(x => x.Split(_kvSeparator, 2)) .ToDictionary(x => x.First(), x => (x.Length == 2) ? x.Last() : ""); return(properties); }