AAPT2: Adding basic binding support

This is incomplete. Still requires:

- filling in layout information in the resulting .bind.xml
- processing elements with <view class=""/>
- processing imports

Change-Id: Ie5d4c5e6435591bbed3248129a548736244894eb
diff --git a/tools/aapt2/Files.cpp b/tools/aapt2/Files.cpp
index 349abbd..8484148 100644
--- a/tools/aapt2/Files.cpp
+++ b/tools/aapt2/Files.cpp
@@ -105,6 +105,17 @@
     return mkdirImpl(path) == 0 || errno == EEXIST;
 }
 
+std::string getStem(const StringPiece& path) {
+    const char* start = path.begin();
+    const char* end = path.end();
+    for (const char* current = end - 1; current != start - 1; --current) {
+        if (*current == sDirSep) {
+            return std::string(start, current - start);
+        }
+    }
+    return {};
+}
+
 bool FileFilter::setPattern(const StringPiece& pattern) {
     mPatternTokens = util::splitAndLowercase(pattern, ':');
     return true;