Move IsDir() to utils.
This patch moves the generic IsDir() function to the utils.cc file
where other similar functions reside. It also adds unit tests for it.
BUG=None
TEST=Added unittests.
Change-Id: Iba05059f72a1156bb5f19ae0624ae7025af4c522
Reviewed-on: https://chromium-review.googlesource.com/200691
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/utils.h b/utils.h
index 2961edf..e83db5c 100644
--- a/utils.h
+++ b/utils.h
@@ -105,6 +105,9 @@
// Returns true if |path| exists and is a symbolic link.
bool IsSymlink(const char* path);
+// Returns true if |path| exists and is a directory.
+bool IsDir(const char* path);
+
// The last 6 chars of path must be XXXXXX. They will be randomly changed
// and a non-existent path will be returned. Intentionally makes a copy
// of the string passed in.