Lines Matching refs:iterator

32 static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator )  in resourcebundle_iterator_read()  argument
35 ResourceBundle_object *rb = iterator->subject; in resourcebundle_iterator_read()
37 rb->child = ures_getByIndex( rb->me, iterator->i, rb->child, &icuerror ); in resourcebundle_iterator_read()
41 if (iterator->is_table) { in resourcebundle_iterator_read()
42 iterator->currentkey = estrdup( ures_getKey( rb->child ) ); in resourcebundle_iterator_read()
44 resourcebundle_extract_value( &iterator->current, rb ); in resourcebundle_iterator_read()
48 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_read()
56 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_invalidate() local
58 if (!Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_invalidate()
59 zval_ptr_dtor( &iterator->current ); in resourcebundle_iterator_invalidate()
60 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_invalidate()
62 if (iterator->currentkey) { in resourcebundle_iterator_invalidate()
63 efree( iterator->currentkey ); in resourcebundle_iterator_invalidate()
64 iterator->currentkey = NULL; in resourcebundle_iterator_invalidate()
72 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_dtor() local
73 zval *object = &iterator->intern.data; in resourcebundle_iterator_dtor()
84 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_has_more() local
85 return (iterator->i < iterator->length) ? SUCCESS : FAILURE; in resourcebundle_iterator_has_more()
92 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_current() local
93 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_current()
94 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_current()
96 return &iterator->current; in resourcebundle_iterator_current()
103 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_key() local
105 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_key()
106 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_key()
109 if (iterator->is_table) { in resourcebundle_iterator_key()
110 ZVAL_STRING(key, iterator->currentkey); in resourcebundle_iterator_key()
112 ZVAL_LONG(key, iterator->i); in resourcebundle_iterator_key()
120 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_step() local
122 iterator->i++; in resourcebundle_iterator_step()
130 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_reset() local
132 iterator->i = 0; in resourcebundle_iterator_reset()
153 ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) ); in resourcebundle_get_iterator() local
159 zend_iterator_init(&iterator->intern); in resourcebundle_get_iterator()
160 ZVAL_COPY(&iterator->intern.data, object); in resourcebundle_get_iterator()
161 iterator->intern.funcs = &resourcebundle_iterator_funcs; in resourcebundle_get_iterator()
163 iterator->subject = rb; in resourcebundle_get_iterator()
168 iterator->is_table = (ures_getType( rb->me ) == URES_TABLE); in resourcebundle_get_iterator()
169 iterator->length = ures_getSize( rb->me ); in resourcebundle_get_iterator()
171 ZVAL_UNDEF(&iterator->current); in resourcebundle_get_iterator()
172 iterator->currentkey = NULL; in resourcebundle_get_iterator()
173 iterator->i = 0; in resourcebundle_get_iterator()
175 return (zend_object_iterator *) iterator; in resourcebundle_get_iterator()