AAPT2: Add a daemon mode

Gradle and other build tools that need to frequently interact with aapt2
can use the daemon mode to issue regular CLI commands without paying
the process start cost for each invocation.

Test: manual
Change-Id: I543858ed46496278bad643f0dae688c924ec6c3f
diff --git a/tools/aapt2/util/Files.h b/tools/aapt2/util/Files.h
index b6aa410..b26e4fa 100644
--- a/tools/aapt2/util/Files.h
+++ b/tools/aapt2/util/Files.h
@@ -34,8 +34,10 @@
 
 #ifdef _WIN32
 constexpr const char sDirSep = '\\';
+constexpr const char sPathSep = ';';
 #else
 constexpr const char sDirSep = '/';
+constexpr const char sPathSep = ':';
 #endif
 
 enum class FileType {
diff --git a/tools/aapt2/util/Util.h b/tools/aapt2/util/Util.h
index f89f8bf..c928458 100644
--- a/tools/aapt2/util/Util.h
+++ b/tools/aapt2/util/Util.h
@@ -228,6 +228,12 @@
  public:
   class iterator {
    public:
+    using reference = android::StringPiece&;
+    using value_type = android::StringPiece;
+    using difference_type = size_t;
+    using pointer = android::StringPiece*;
+    using iterator_category = std::forward_iterator_tag;
+
     iterator(const iterator&) = default;
     iterator& operator=(const iterator&) = default;
 
@@ -250,9 +256,13 @@
 
   Tokenizer(const android::StringPiece& str, char sep);
 
-  iterator begin() { return begin_; }
+  iterator begin() const {
+    return begin_;
+  }
 
-  iterator end() { return end_; }
+  iterator end() const {
+    return end_;
+  }
 
  private:
   const iterator begin_;