public string[] searchUIDs(string expr, string [] sub) { CamelException ex = new CamelException(); Util.UIDArray uids = new Util.UIDArray(sub); IntPtr o = camel_folder_search_by_uids(cobject, expr, ref uids, ref ex); if (ex.id != 0) throw new Camel.Exception(ex); uids = new Util.UIDArray(o); camel_folder_search_free(cobject, o); return uids.uids; }
static extern IntPtr camel_folder_get_message(IntPtr o, string uid, ref CamelException ex);
public Exception(CamelException ex) { id = (Type)ex.id; desc = ex.desc; }
public MimeMessage getMessage(string uid) { CamelException ex = new CamelException(); IntPtr o = camel_folder_get_message(cobject, uid, ref ex); if (ex.id != 0) throw new Camel.Exception(ex); return (MimeMessage)fromCamel(o); }
public URL(string uri) { CamelException ex = new CamelException(); cobject = camel_url_new(uri, ref ex); if (ex.id != 0) throw new Exception(ex); }
static extern IntPtr camel_url_new(string url, ref CamelException ex);
static extern IntPtr camel_store_get_folder(IntPtr o, string name, int flags, ref CamelException ex);
public Camel.Object getObject(int type) { IntPtr o; Camel.Object co; CamelException ex = new CamelException(); o = camel_object_get_ptr(cobject, ref ex, type); if (ex.id != 0) throw new Camel.Exception(ex); co = fromCamel(o); camel_object_free(cobject, type, o); return co; }
public Service getService(string uri, Provider.Type type) { IntPtr s; CamelException ex = new CamelException(); s = camel_session_get_service(cobject, uri, (int)type, ref ex); if (ex.id != 0) throw new Camel.Exception(ex); return (Service)fromCamel(s); }
static extern IntPtr camel_session_get_service_connected(IntPtr o, string uri, int type, ref CamelException ex);
static extern IntPtr camel_object_get_ptr(IntPtr raw, ref CamelException ex, int tag);
static extern int camel_object_get_int(IntPtr raw, ref CamelException ex, int tag);
// maybe we want an indexer class to get properties? // e.g. name = folder.properties[Folder.Tag.NAME] public String getString(int type) { String s; IntPtr o; CamelException ex = new CamelException(); o = camel_object_get_ptr(cobject, ref ex, type); if (ex.id != 0) throw new Camel.Exception(ex); s = Marshal.PtrToStringAuto(o); camel_object_free(cobject, type, o); return s; }
static extern IntPtr camel_folder_search_by_expression(IntPtr o, string expr, ref CamelException ex);
Folder getFolder(string name, int flags) { IntPtr s; CamelException ex = new CamelException(); s = camel_store_get_folder(cobject, name, flags, ref ex); if (ex.id != 0) throw new Camel.Exception(ex); return (Folder)fromCamel(s); }
static extern IntPtr camel_folder_search_by_uids(IntPtr o, string expr, ref Util.UIDArray uids, ref CamelException ex);
public int getInt(int type) { int r; CamelException ex = new CamelException(); r = camel_object_get_int(cobject, ref ex, type); if (ex.id != 0) throw new Camel.Exception(ex); return r; }