Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. dirNode *dirNode::findNode(string pathname) {
  2. dirTokenizer path = dirTokenizer(pathname);
  3. string dir = path.next();
  4. dirNode *cur=this;
  5. if (cur‐>name != dir) return NULL;
  6. dir = path.next();
  7. if (dir == "") return cur;
  8. cur = cur‐>firstChild;
  9. while (cur != NULL) {
  10. if (cur‐>name != dir) {
  11. cur = cur‐>nextSibling;
  12. continue;
  13. }
  14. dir = path.next();
  15. if (dir == "") return cur;
  16. else cur = cur‐>firstChild;
  17. }
  18. return cur;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement