// WARNING - AUTOGENERATED - DO NOT EDIT // // Generated using `sharpie urho` // // HttpRequest.cs // // Copyright 2015 Xamarin Inc. All rights reserved. using System; using System.Runtime.InteropServices; using System.Collections.Generic; using Urho.Urho2D; using Urho.Gui; using Urho.Resources; using Urho.IO; using Urho.Navigation; using Urho.Network; namespace Urho.Network { /// /// An HTTP connection with response data stream. /// public unsafe partial class HttpRequest : RefCounted, IDeserializer { unsafe partial void OnHttpRequestCreated (); [Preserve] public HttpRequest (IntPtr handle) : base (handle) { OnHttpRequestCreated (); } [Preserve] protected HttpRequest (UrhoObjectFlag emptyFlag) : base (emptyFlag) { OnHttpRequestCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void HttpRequest_ThreadFunction (IntPtr handle); /// /// Process the connection in the worker thread until closed. /// public void ThreadFunction () { Runtime.ValidateRefCounted (this); HttpRequest_ThreadFunction (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint HttpRequest_Read (IntPtr handle, IntPtr dest, uint size); /// /// Read response data from the HTTP connection and return number of bytes actually read. While the connection is open, will block while trying to read the specified size. To avoid blocking, only read up to as many bytes as GetAvailableSize() returns. /// public uint Read (IntPtr dest, uint size) { Runtime.ValidateRefCounted (this); return HttpRequest_Read (handle, dest, size); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint HttpRequest_Seek (IntPtr handle, uint position); /// /// Set position from the beginning of the stream. Not supported. /// public uint Seek (uint position) { Runtime.ValidateRefCounted (this); return HttpRequest_Seek (handle, position); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool HttpRequest_IsEof (IntPtr handle); /// /// Return whether all response data has been read. /// private bool IsEof () { Runtime.ValidateRefCounted (this); return HttpRequest_IsEof (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr HttpRequest_GetURL (IntPtr handle); /// /// Return URL used in the request. /// private string GetURL () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (HttpRequest_GetURL (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr HttpRequest_GetVerb (IntPtr handle); /// /// Return verb used in the request. Default GET if empty verb specified on construction. /// private string GetVerb () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (HttpRequest_GetVerb (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr HttpRequest_GetError (IntPtr handle); /// /// Return error. Only non-empty in the error state. /// private string GetError () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (HttpRequest_GetError (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern HttpRequestState HttpRequest_GetState (IntPtr handle); /// /// Return connection state. /// private HttpRequestState GetState () { Runtime.ValidateRefCounted (this); return HttpRequest_GetState (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint HttpRequest_GetAvailableSize (IntPtr handle); /// /// Return amount of bytes in the read buffer. /// private uint GetAvailableSize () { Runtime.ValidateRefCounted (this); return HttpRequest_GetAvailableSize (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool HttpRequest_IsOpen (IntPtr handle); /// /// Return whether connection is in the open state. /// public bool IsOpen () { Runtime.ValidateRefCounted (this); return HttpRequest_IsOpen (handle); } /// /// Return whether all response data has been read. /// public bool Eof { get { return IsEof (); } } /// /// Return URL used in the request. /// public string URL { get { return GetURL (); } } /// /// Return verb used in the request. Default GET if empty verb specified on construction. /// public string Verb { get { return GetVerb (); } } /// /// Return error. Only non-empty in the error state. /// public string Error { get { return GetError (); } } /// /// Return connection state. /// public HttpRequestState State { get { return GetState (); } } /// /// Return amount of bytes in the read buffer. /// public uint AvailableSize { get { return GetAvailableSize (); } } } }