+
+ /**
+ * Determines whether a file name corresponds to a file in this directory.
+ * @param name name of file to evaluate
+ * @return true iff file has been opened in this directory or exists on the
+ * file system within this directory
+ */
+ bool isFile(const std::string &name) const;
+
+ /**
+ * Returns true if stream is open and not standard output or error.
+ * @param os output stream to evaluate
+ * @return true if os is non-NULL and not cout or cerr
+ */
+ static inline bool isFile(const std::ostream &os) {
+ return isFile(&os);
+ }
+
+ /**
+ * Creates a subdirectory within this directory.
+ * @param name name of subdirectory
+ * @return the new subdirectory's name suffixed with a path separator
+ */
+ std::string createSubdirectory(const std::string &name) const;
+
+ /**
+ * Removes a specified file or subdirectory.
+ *
+ * Will cause sim to fail for most errors. However, it will only warn the
+ * user if a directory could not be removed. This is in place to
+ * accommodate slow file systems where file deletions within a subdirectory
+ * may not be recognized quickly enough thereby causing the subsequent call
+ * to remove the directory to fail (seemingly unempty directory).
+ *
+ * @param name name of file or subdirectory to remove; name should not
+ * be prepended with the name of this directory object
+ * @param recursive set to true to attempt to recursively delete a
+ * subdirectory and its contents
+ */
+ void remove(const std::string &name, bool recursive=false);