示例#1
0
 /// <summary>
 /// FillInfo Method
 /// </summary>
 /// <remarks>
 /// Handle buffer requests for an exporter that wants to expose buf of size len with writability set according to readonly. buf is interpreted as a sequence of unsigned bytes.
 /// The flags argument indicates the request type. This function always fills in view as specified by flags, unless buf has been designated as read-only and PyBUF_WRITABLE is set in flags.
 /// On success, set view->obj to a new reference to exporter and return 0. Otherwise, raise PyExc_BufferError, set view->obj to NULL and return -1;
 /// If this function is used as part of a getbufferproc, exporter MUST be set to the exporting object and flags must be passed unmodified.Otherwise, exporter MUST be NULL.
 /// </remarks>
 /// <returns>On success, set view->obj to a new reference to exporter and return 0. Otherwise, raise PyExc_BufferError, set view->obj to NULL and return -1;</returns>
 public void FillInfo(IntPtr exporter, IntPtr buf, long len, bool _readonly, int flags)
 {
     if (disposedValue)
     {
         throw new ObjectDisposedException(nameof(PyBuffer));
     }
     if (Runtime.PyBuffer_FillInfo(ref _view, exporter, buf, (IntPtr)len, Convert.ToInt32(_readonly), flags) < 0)
     {
         throw PythonException.ThrowLastAsClrException();
     }
 }