public InternString(IntPtr handle, Transfer ownership) : base(handle) { if (ownership != Transfer.None) { throw new InvalidOperationException("Interned strings can never be owned"); } stringValue = GMarshal.Utf8PtrToString(handle); }
public static InternString Get(string @string) { var string_ = GMarshal.StringToUtf8Ptr(@string); var ret_ = g_intern_string(string_); GMarshal.Free(string_); var ret = new InternString(ret_, Transfer.None); return(ret); }