Lines Matching refs:iterator
30 static void resourcebundle_iterator_read( ResourceBundle_iterator *iterator ) in resourcebundle_iterator_read() argument
33 ResourceBundle_object *rb = iterator->subject; in resourcebundle_iterator_read()
35 rb->child = ures_getByIndex( rb->me, iterator->i, rb->child, &icuerror ); in resourcebundle_iterator_read()
39 if (iterator->is_table) { in resourcebundle_iterator_read()
40 iterator->currentkey = estrdup( ures_getKey( rb->child ) ); in resourcebundle_iterator_read()
42 resourcebundle_extract_value( &iterator->current, rb ); in resourcebundle_iterator_read()
45 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_read()
53 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_invalidate() local
55 if (!Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_invalidate()
56 zval_ptr_dtor( &iterator->current ); in resourcebundle_iterator_invalidate()
57 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_invalidate()
59 if (iterator->currentkey) { in resourcebundle_iterator_invalidate()
60 efree( iterator->currentkey ); in resourcebundle_iterator_invalidate()
61 iterator->currentkey = NULL; in resourcebundle_iterator_invalidate()
69 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_dtor() local
70 zval *object = &iterator->intern.data; in resourcebundle_iterator_dtor()
81 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_has_more() local
82 return (iterator->i < iterator->length) ? SUCCESS : FAILURE; in resourcebundle_iterator_has_more()
89 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_current() local
90 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_current()
91 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_current()
93 return &iterator->current; in resourcebundle_iterator_current()
100 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_key() local
102 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_key()
103 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_key()
106 if (iterator->is_table) { in resourcebundle_iterator_key()
107 ZVAL_STRING(key, iterator->currentkey); in resourcebundle_iterator_key()
109 ZVAL_LONG(key, iterator->i); in resourcebundle_iterator_key()
117 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_step() local
119 iterator->i++; in resourcebundle_iterator_step()
127 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_reset() local
129 iterator->i = 0; in resourcebundle_iterator_reset()
156 ResourceBundle_iterator *iterator = emalloc( sizeof( ResourceBundle_iterator ) ); in resourcebundle_get_iterator() local
158 zend_iterator_init(&iterator->intern); in resourcebundle_get_iterator()
160 ZVAL_OBJ(&iterator->intern.data, Z_OBJ_P(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()