}
%newobject clone;
Selection *clone(int flags = 0) {
- Selection *s;
- s = solv_calloc(1, sizeof(*s));
- s->pool = $self->pool;
+ Selection *s = new_Selection($self->pool);
+ queue_init_clone(&s->q, &$self->q);
s->flags = $self->flags;
- queue_init_clone(&s>q, &$self>q);
return s;
}
void filter(Selection *lsel) {
.\" Title: Libsolv-Bindings
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 01/18/2018
+.\" Date: 02/28/2018
.\" Manual: LIBSOLV
.\" Source: libsolv
.\" Language: English
.\"
-.TH "LIBSOLV\-BINDINGS" "3" "02/27/2018" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-BINDINGS" "3" "02/28/2018" "libsolv" "LIBSOLV"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.RS 4
.\}
.nf
-\fBint flags()\fR;
+\fBint flags()\fR
my \fI$flags\fR \fB=\fR \fI$sel\fR\fB\->flags()\fR;
\fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
\fIflags\fR \fB=\fR \fIsel\fR\fB\&.flags()\fR
.RS 4
.\}
.nf
-\fBbool isempty()\fR;
+\fBbool isempty()\fR
\fI$sel\fR\fB\->isempty()\fR
\fIsel\fR\fB\&.isempty()\fR
\fIsel\fR\fB\&.isempty?\fR
.RS 4
.\}
.nf
-\fBSelection clone(int\fR \fIflags\fR \fB= 0)\fR;
+\fBSelection clone(int\fR \fIflags\fR \fB= 0)\fR
my \fI$cloned\fR \fB=\fR \fI$sel\fR\fB\->clone()\fR;
\fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
\fIcloned\fR \fB=\fR \fIsel\fR\fB\&.clone()\fR
.RE
.\}
.sp
-Clone selection\&.
+Return a copy of a selection\&.
.sp
.if n \{\
.RS 4
=== METHODS ===
- int flags();
+ int flags()
my $flags = $sel->flags();
flags = sel.flags()
flags = sel.flags()
if there was a package that matched the name or not. If there was
no match at all, the flags will be zero.
- bool isempty();
+ bool isempty()
$sel->isempty()
sel.isempty()
sel.isempty?
Return true if the selection is empty, i.e. no package could be matched.
+ Selection clone(int flags = 0)
+ my $cloned = $sel->clone();
+ cloned = sel.clone()
+ cloned = sel.clone()
+
+Return a copy of a selection.
+
void filter(Selection *other)
$sel->filter($other);
sel.filter(other)