public static string RelationToString(RC.PackageRelation relation, int words) { IntPtr raw_ret = rc_package_relation_to_string((int)relation, words); string ret = GLib.Marshaller.Utf8PtrToString(raw_ret); return(ret); }
public static RC.PackageRelation RelationFromString(string relation) { IntPtr relation_as_native = GLib.Marshaller.StringToPtrGStrdup(relation); int raw_ret = rc_package_relation_from_string(relation_as_native); RC.PackageRelation ret = (RC.PackageRelation)raw_ret; GLib.Marshaller.Free(relation_as_native); return(ret); }
private void ParseXmlNode(System.Xml.XmlTextReader reader) { string name = null; string version = null; string release = null; bool has_epoch = false; uint epoch = 0; RC.PackageRelation relation = PackageRelation.Any; RC.Channel channel = Channel.ANY; name = reader["name"]; string tmp = reader["op"]; if (tmp != null) { relation = Package.RelationFromString(tmp); version = reader["version"]; release = reader["release"]; tmp = reader["epoch"]; if (tmp != null) { has_epoch = true; epoch = System.Xml.XmlConvert.ToUInt32(tmp); } } IntPtr name_as_native = GLib.Marshaller.StringToPtrGStrdup(name); IntPtr version_as_native = GLib.Marshaller.StringToPtrGStrdup(version); IntPtr release_as_native = GLib.Marshaller.StringToPtrGStrdup(release); Raw = rc_package_dep_new(name_as_native, has_epoch, epoch, version_as_native, release_as_native, (int)relation, channel.Handle, false, false); GLib.Marshaller.Free(name_as_native); GLib.Marshaller.Free(version_as_native); GLib.Marshaller.Free(release_as_native); }
public PackageDep(RC.PackageSpec spec, RC.PackageRelation relation, RC.Channel channel, bool pre, bool is_or) { Raw = rc_package_dep_new_from_spec(spec.Handle, (int)relation, channel == null ? IntPtr.Zero : channel.Handle, pre, is_or); }
public PackageDep(string name, bool has_epoch, uint epoch, string version, string release, RC.PackageRelation relation, RC.Channel channel, bool pre, bool is_or) { IntPtr name_as_native = GLib.Marshaller.StringToPtrGStrdup(name); IntPtr version_as_native = GLib.Marshaller.StringToPtrGStrdup(version); IntPtr release_as_native = GLib.Marshaller.StringToPtrGStrdup(release); Raw = rc_package_dep_new(name_as_native, has_epoch, epoch, version_as_native, release_as_native, (int)relation, channel == null ? IntPtr.Zero : channel.Handle, pre, is_or); GLib.Marshaller.Free(name_as_native); GLib.Marshaller.Free(version_as_native); GLib.Marshaller.Free(release_as_native); }