Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
22
Src/Wasabi/bfc/foreach.cpp
Normal file
22
Src/Wasabi/bfc/foreach.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include "foreach.h"
|
||||
|
||||
__foreach::__foreach(const PtrListRoot &ptrlist, int reverse) :
|
||||
list(ptrlist.getNumItems(), ptrlist.getItemList()), pos(0)
|
||||
{
|
||||
if (reverse) list.reverse();
|
||||
}
|
||||
|
||||
__foreach::__foreach(const PtrListRoot *ptrlist, int reverse) :
|
||||
list(ptrlist->getNumItems(), ptrlist->getItemList()), pos(0) {
|
||||
if (reverse) list.reverse();
|
||||
}
|
||||
|
||||
int __foreach::done() const { return (pos >= list.getSize()); }
|
||||
|
||||
void *__foreach::next(int advance) { if (advance) pos++; return getPtr(); }
|
||||
|
||||
void *__foreach::getPtr() const { return (pos < list.getSize()) ? list[pos] : NULL; }
|
||||
|
||||
int __foreach::getPos() const { return pos; }
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue