예제 #1
0
 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);
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public Dictionary <string, string> Info()
        {
            var zstr = ZnInfoAsStr(_nativePtr);

            return(ZTypes.ZStringToProperties(zstr));
        }