source: appstream-generator/build/girepo/glib/SequenceIter.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 4.5 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module glib.SequenceIter;
22
23private import gi.glib;
24public  import gi.glibtypes;
25private import glib.Sequence;
26
27
28/**
29 * The #GSequenceIter struct is an opaque data type representing an
30 * iterator pointing into a #GSequence.
31 */
32public class SequenceIter
33{
34        /** the main Gtk struct */
35        protected GSequenceIter* gSequenceIter;
36        protected bool ownedRef;
37
38        /** Get the main Gtk struct */
39        public GSequenceIter* getSequenceIterStruct()
40        {
41                return gSequenceIter;
42        }
43
44        /** the main Gtk struct as a void* */
45        protected void* getStruct()
46        {
47                return cast(void*)gSequenceIter;
48        }
49
50        /**
51         * Sets our main struct and passes it to the parent class.
52         */
53        public this (GSequenceIter* gSequenceIter, bool ownedRef = false)
54        {
55                this.gSequenceIter = gSequenceIter;
56                this.ownedRef = ownedRef;
57        }
58
59
60        /**
61         * Returns a negative number if @a comes before @b, 0 if they are equal,
62         * and a positive number if @a comes after @b.
63         *
64         * The @a and @b iterators must point into the same sequence.
65         *
66         * Params:
67         *     b = a #GSequenceIter
68         *
69         * Returns: a negative number if @a comes before @b, 0 if they are
70         *     equal, and a positive number if @a comes after @b
71         *
72         * Since: 2.14
73         */
74        public int compare(SequenceIter b)
75        {
76                return g_sequence_iter_compare(gSequenceIter, (b is null) ? null : b.getSequenceIterStruct());
77        }
78
79        /**
80         * Returns the position of @iter
81         *
82         * Returns: the position of @iter
83         *
84         * Since: 2.14
85         */
86        public int getPosition()
87        {
88                return g_sequence_iter_get_position(gSequenceIter);
89        }
90
91        /**
92         * Returns the #GSequence that @iter points into.
93         *
94         * Returns: the #GSequence that @iter points into
95         *
96         * Since: 2.14
97         */
98        public Sequence getSequence()
99        {
100                auto p = g_sequence_iter_get_sequence(gSequenceIter);
101               
102                if(p is null)
103                {
104                        return null;
105                }
106               
107                return new Sequence(cast(GSequence*) p);
108        }
109
110        /**
111         * Returns whether @iter is the begin iterator
112         *
113         * Returns: whether @iter is the begin iterator
114         *
115         * Since: 2.14
116         */
117        public bool isBegin()
118        {
119                return g_sequence_iter_is_begin(gSequenceIter) != 0;
120        }
121
122        /**
123         * Returns whether @iter is the end iterator
124         *
125         * Returns: Whether @iter is the end iterator
126         *
127         * Since: 2.14
128         */
129        public bool isEnd()
130        {
131                return g_sequence_iter_is_end(gSequenceIter) != 0;
132        }
133
134        /**
135         * Returns the #GSequenceIter which is @delta positions away from @iter.
136         * If @iter is closer than -@delta positions to the beginning of the sequence,
137         * the begin iterator is returned. If @iter is closer than @delta positions
138         * to the end of the sequence, the end iterator is returned.
139         *
140         * Params:
141         *     delta = A positive or negative number indicating how many positions away
142         *         from @iter the returned #GSequenceIter will be
143         *
144         * Returns: a #GSequenceIter which is @delta positions away from @iter
145         *
146         * Since: 2.14
147         */
148        public SequenceIter move(int delta)
149        {
150                auto p = g_sequence_iter_move(gSequenceIter, delta);
151               
152                if(p is null)
153                {
154                        return null;
155                }
156               
157                return new SequenceIter(cast(GSequenceIter*) p);
158        }
159
160        /**
161         * Returns an iterator pointing to the next position after @iter.
162         * If @iter is the end iterator, the end iterator is returned.
163         *
164         * Returns: a #GSequenceIter pointing to the next position after @iter
165         *
166         * Since: 2.14
167         */
168        public SequenceIter next()
169        {
170                auto p = g_sequence_iter_next(gSequenceIter);
171               
172                if(p is null)
173                {
174                        return null;
175                }
176               
177                return new SequenceIter(cast(GSequenceIter*) p);
178        }
179
180        /**
181         * Returns an iterator pointing to the previous position before @iter.
182         * If @iter is the begin iterator, the begin iterator is returned.
183         *
184         * Returns: a #GSequenceIter pointing to the previous position
185         *     before @iter
186         *
187         * Since: 2.14
188         */
189        public SequenceIter prev()
190        {
191                auto p = g_sequence_iter_prev(gSequenceIter);
192               
193                if(p is null)
194                {
195                        return null;
196                }
197               
198                return new SequenceIter(cast(GSequenceIter*) p);
199        }
200}
Note: See TracBrowser for help on using the repository browser.