summaryrefslogtreecommitdiff
path: root/tools/aapt/Utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/Utils.h')
-rw-r--r--tools/aapt/Utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/aapt/Utils.h b/tools/aapt/Utils.h
index 8eb594138478..f0d69799f7e2 100644
--- a/tools/aapt/Utils.h
+++ b/tools/aapt/Utils.h
@@ -26,3 +26,13 @@
// If the default OS separator is backslash, this converts all
// backslashes to slashes, in-place. Otherwise it does nothing.
void convertToResPath(android::String8&);
+
+/**
+ * Retrieve the front (root dir) component. Optionally also return the
+ * remaining components.
+ *
+ * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c")
+ * "/tmp" --> "tmp" (remain = "")
+ * "bar.c" --> "bar.c" (remain = "")
+ */
+android::String8 walkPath(const android::String8& path, android::String8* outRemains = nullptr);