예제 #1
0
        public GLibString(string value)
        {
            if (value == null)
            {
                Pointer = IntPtr.Zero;
            }

            byte[] bytes = Encoding.UTF8.GetBytes(value);
            Pointer = GLib.Malloc(new UIntPtr((ulong)bytes.Length + 1));
            Marshal.Copy(bytes, 0, Pointer, bytes.Length);
            Marshal.WriteByte(Pointer, bytes.Length, 0);
        }