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()
46 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_read()
54 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_invalidate() local
56 if (!Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_invalidate()
57 zval_ptr_dtor( &iterator->current ); in resourcebundle_iterator_invalidate()
58 ZVAL_UNDEF(&iterator->current); in resourcebundle_iterator_invalidate()
60 if (iterator->currentkey) { in resourcebundle_iterator_invalidate()
61 efree( iterator->currentkey ); in resourcebundle_iterator_invalidate()
62 iterator->currentkey = NULL; in resourcebundle_iterator_invalidate()
70 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_dtor() local
71 zval *object = &iterator->intern.data; in resourcebundle_iterator_dtor()
82 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_has_more() local
83 return (iterator->i < iterator->length) ? SUCCESS : FAILURE; in resourcebundle_iterator_has_more()
90 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_current() local
91 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_current()
92 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_current()
94 return &iterator->current; in resourcebundle_iterator_current()
101 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_key() local
103 if (Z_ISUNDEF(iterator->current)) { in resourcebundle_iterator_key()
104 resourcebundle_iterator_read( iterator); in resourcebundle_iterator_key()
107 if (iterator->is_table) { in resourcebundle_iterator_key()
108 ZVAL_STRING(key, iterator->currentkey); in resourcebundle_iterator_key()
110 ZVAL_LONG(key, iterator->i); in resourcebundle_iterator_key()
118 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_step() local
120 iterator->i++; in resourcebundle_iterator_step()
128 ResourceBundle_iterator *iterator = (ResourceBundle_iterator *) iter; in resourcebundle_iterator_reset() local
130 iterator->i = 0; in resourcebundle_iterator_reset()
152 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()