class Dir
{
public:
+ Dir();
+ ~Dir();
+
+ /**
+ * when this directory object is destroyed, remove the corresponding
+ * diretory (and its contents) from the disk. Often used with temporary
+ * directories to ensure they are cleaned up.
+ */
+ void setRemoveOnDestroy();
+
static Dir current();
/**
PathList children(int types = 0, const std::string& nameGlob = "") const;
+ /**
+ * test if the directory contains no children (except '.' and '..')
+ */
+ bool isEmpty() const;
+
SGPath file(const std::string& name) const;
SGPath path() const
*/
bool remove(bool recursive = false);
+ /**
+ * remove our children but not us
+ */
+ bool removeChildren() const;
+
+
/**
* Check that the directory at the path exists (and is a directory!)
*/
Dir parent() const;
private:
mutable SGPath _path;
+ bool _removeOnDestroy;
};
} // of namespace simgear