Пример #1
0
        public CString(string str, CEncoding env = CEncoding.Ascii)
        {
            Enc = env.ToEncoding();
            Str = str;

            var data = Enc.GetBytes(str + '\0');

            Size = data.Length;
            Alloc(Size);
            Marshal.Copy(data, 0, Ptr, Size);
        }
Пример #2
0
 public static int GetStride(this CEncoding self) => self.ToEncoding().GetStride();