bool File::isAChildOf (const File& potentialParent) const { if (potentialParent.fullPath.isEmpty()) return false; auto ourPath = getPathUpToLastSlash(); if (compareFilenames (potentialParent.fullPath, ourPath) == 0) return true; if (potentialParent.fullPath.length() >= ourPath.length()) return false; return getParentDirectory().isAChildOf (potentialParent); }
File File::getParentDirectory() const { return File (getPathUpToLastSlash(), (int) 0); }
File File::getParentDirectory() const { File f; f.fullPath = getPathUpToLastSlash(); return f; }
File File::getParentDirectory() const { return createFileWithoutCheckingPath (getPathUpToLastSlash()); }
Path Path::getParentDirectory() const { Path f; f.fullPath = getPathUpToLastSlash(); return f; }