@@ -288,6 +288,34 @@ Napi::Value Napi::Object::operator[] (uint32_t index) const;
288
288
289
289
Returns an indexed property or array element as a [ ` Napi::Value ` ] ( value.md ) .
290
290
291
+ ### begin()
292
+
293
+ ``` cpp
294
+ Napi::Object::iterator Napi::Object::begin () const ;
295
+ ```
296
+
297
+ Returns a constant iterator to the beginning of the object.
298
+
299
+ ``` cpp
300
+ Napi::Object::iterator Napi::Object::begin ();
301
+ ```
302
+
303
+ Returns a non constant iterator to the beginning of the object.
304
+
305
+ ### end()
306
+
307
+ ``` cpp
308
+ Napi::Object::iterator Napi::Object::end () const ;
309
+ ```
310
+
311
+ Returns a constant iterator to the end of the object.
312
+
313
+ ``` cpp
314
+ Napi::Object::iterator Napi::Object::end ();
315
+ ```
316
+
317
+ Returns a non constant iterator to the end of the object.
318
+
291
319
## Iterator
292
320
293
321
Iterators expose an ` std::pair<...> ` , where the ` first ` property is a
@@ -300,6 +328,41 @@ exceptions are enabled (by defining `NAPI_CPP_EXCEPTIONS` during the build).
300
328
301
329
In constant iterators, the iterated values are immutable.
302
330
331
+ #### operator++()
332
+
333
+ ``` cpp
334
+ inline Napi::Object::const_iterator& Napi::Object::const_iterator::operator ++();
335
+ ```
336
+
337
+ Moves the iterator one step forward.
338
+
339
+ #### operator==
340
+
341
+ ``` cpp
342
+ inline bool Napi::Object::const_iterator::operator ==(const Napi::Object::const_iterator& other) const ;
343
+ ```
344
+ - ` [in] other ` : Another iterator to compare the current iterator to.
345
+
346
+ Returns whether both iterators are at the same index.
347
+
348
+ #### operator!=
349
+
350
+ ``` cpp
351
+ inline bool Napi::Object::const_iterator::operator !=(const Napi::Object::const_iterator& other) const ;
352
+ ```
353
+ - ` [in] other ` : Another iterator to compare the current iterator to.
354
+
355
+ Returns whether both iterators are at different indices.
356
+
357
+ #### operator* ()
358
+
359
+ ``` cpp
360
+ inline const std::pair<Napi::Value, Napi::Object::PropertyLValue<Napi::Value>> Napi::Object::const_iterator::operator *() const ;
361
+ ```
362
+
363
+ Returns the currently iterated key and value.
364
+
365
+ #### Example
303
366
``` cpp
304
367
Value Sum (const CallbackInfo& info) {
305
368
Object object = info[ 0] .As<Object >();
@@ -317,6 +380,41 @@ Value Sum(const CallbackInfo& info) {
317
380
318
381
In non constant iterators, the iterated values are mutable.
319
382
383
+ #### operator++()
384
+
385
+ ```cpp
386
+ inline Napi::Object::iterator& Napi::Object::iterator::operator++();
387
+ ```
388
+
389
+ Moves the iterator one step forward.
390
+
391
+ #### operator==
392
+
393
+ ``` cpp
394
+ inline bool Napi::Object::iterator::operator ==(const Napi::Object::iterator& other) const ;
395
+ ```
396
+ - ` [in] other ` : Another iterator to compare the current iterator to.
397
+
398
+ Returns whether both iterators are at the same index.
399
+
400
+ #### operator!=
401
+
402
+ ``` cpp
403
+ inline bool Napi::Object::iterator::operator !=(const Napi::Object::iterator& other) const ;
404
+ ```
405
+ - ` [in] other ` : Another iterator to compare the current iterator to.
406
+
407
+ Returns whether both iterators are at different indices.
408
+
409
+ #### operator* ()
410
+
411
+ ``` cpp
412
+ inline std::pair<Napi::Value, Napi::Object::PropertyLValue<Napi::Value>> Napi::Object::iterator::operator *();
413
+ ```
414
+
415
+ Returns the currently iterated key and value.
416
+
417
+ #### Example
320
418
``` cpp
321
419
void Increment (const CallbackInfo& info) {
322
420
Env env = info.Env();
0 commit comments