/// <summary> /// Create a new CfxStreamReader object from a file. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public static CfxStreamReader CreateForFile(string fileName) { var fileName_pinned = new PinnedString(fileName); var __retval = CfxApi.StreamReader.cfx_stream_reader_create_for_file(fileName_pinned.Obj.PinnedPtr, fileName_pinned.Length); fileName_pinned.Obj.Free(); return(CfxStreamReader.Wrap(__retval)); }
/// <summary> /// Create a new CfxXmlReader object. The returned object's functions can /// only be called from the thread that created the object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_xml_reader_capi.h">cef/include/capi/cef_xml_reader_capi.h</see>. /// </remarks> public static CfxXmlReader Create(CfxStreamReader stream, CfxXmlEncodingType encodingType, string uri) { var uri_pinned = new PinnedString(uri); var __retval = CfxApi.cfx_xml_reader_create(CfxStreamReader.Unwrap(stream), (int)encodingType, uri_pinned.Obj.PinnedPtr, uri_pinned.Length); uri_pinned.Obj.Free(); return(CfxXmlReader.Wrap(__retval)); }
internal static CfxStreamReader Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxStreamReader)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxStreamReader(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
/// <summary> /// Create a new CfxZipReader object. The returned object's functions can /// only be called from the thread that created the object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_zip_reader_capi.h">cef/include/capi/cef_zip_reader_capi.h</see>. /// </remarks> public static CfxZipReader Create(CfxStreamReader stream) { return(CfxZipReader.Wrap(CfxApi.ZipReader.cfx_zip_reader_create(CfxStreamReader.Unwrap(stream)))); }
/// <summary> /// Create a new CfxStreamReader object from a custom handler. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public static CfxStreamReader CreateForHandler(CfxReadHandler handler) { return(CfxStreamReader.Wrap(CfxApi.StreamReader.cfx_stream_reader_create_for_handler(CfxReadHandler.Unwrap(handler)))); }
/// <summary> /// Create a new CfxStreamReader object from data. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public static CfxStreamReader CreateForData(IntPtr data, ulong size) { return(CfxStreamReader.Wrap(CfxApi.StreamReader.cfx_stream_reader_create_for_data(data, (UIntPtr)size))); }
/// <summary> /// Create a new CfxXmlReader object. The returned object's functions can /// only be called from the thread that created the object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_xml_reader_capi.h">cef/include/capi/cef_xml_reader_capi.h</see>. /// </remarks> public static CfxXmlReader Create(CfxStreamReader stream, CfxXmlEncodingType encodingType, string uri) { var uri_pinned = new PinnedString(uri); var __retval = CfxApi.cfx_xml_reader_create(CfxStreamReader.Unwrap(stream), (int)encodingType, uri_pinned.Obj.PinnedPtr, uri_pinned.Length); uri_pinned.Obj.Free(); return CfxXmlReader.Wrap(__retval); }
/// <summary> /// Create a new CfxZipReader object. The returned object's functions can /// only be called from the thread that created the object. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_zip_reader_capi.h">cef/include/capi/cef_zip_reader_capi.h</see>. /// </remarks> public static CfxZipReader Create(CfxStreamReader stream) { return CfxZipReader.Wrap(CfxApi.cfx_zip_reader_create(CfxStreamReader.Unwrap(stream))); }
/// <summary> /// Create a new CfxStreamReader object from data. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>. /// </remarks> public static CfxStreamReader CreateForData(IntPtr data, int size) { return(CfxStreamReader.Wrap(CfxApi.cfx_stream_reader_create_for_data(data, size))); }
internal static CfxStreamReader Wrap(IntPtr nativePtr) { if(nativePtr == IntPtr.Zero) return null; lock(weakCache) { var wrapper = (CfxStreamReader)weakCache.Get(nativePtr); if(wrapper == null) { wrapper = new CfxStreamReader(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return wrapper; } }
/// <summary> /// Continue the request. Read the resource contents from |stream|. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_extension_handler_capi.h">cef/include/capi/cef_extension_handler_capi.h</see>. /// </remarks> public void Continue(CfxStreamReader stream) { CfxApi.GetExtensionResourceCallback.cfx_get_extension_resource_callback_cont(NativePtr, CfxStreamReader.Unwrap(stream)); }