Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct DirIterator
- {
- private:
- RefCounted!(DirIteratorImpl, RefCountedAutoInitialize.no) impl;
- this(string pathname, SpanMode mode, bool followSymlink)
- {
- impl = typeof(impl)(pathname, mode, followSymlink);
- }
- public:
- @property bool empty(){ return impl.empty; }
- @property DirEntry front(){ return impl.front; }
- void popFront(){ impl.popFront(); }
- int opApply(int delegate(ref string name) dg)
- {
- writeln("we're in oppapply");
- foreach(DirEntry v; impl.refCountedPayload)
- {
- string s = v.name;
- if(dg(s))
- return 1;
- }
- return 0;
- }
- int opApply(int delegate(ref DirEntry name) dg)
- {
- writeln("we're in oppapply");
- foreach(DirEntry v; impl.refCountedPayload)
- if(dg(v))
- return 1;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement