AAPT2: Share split functionality between link and optimize

Generating splits should be possible to do from the optimize command.
This means that a lot of infrastructure around split APKs can be
shared by both the optimize and link phase.

Bug: 35925830
Change-Id: Ia88b9e4bff300a56353b2f7a4a2547c8eb43a299
Test: manual
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h
index a626d37..d1232a2 100644
--- a/tools/aapt2/StringPool.h
+++ b/tools/aapt2/StringPool.h
@@ -23,6 +23,7 @@
 #include <unordered_map>
 #include <vector>
 
+#include "android-base/macros.h"
 #include "androidfw/StringPiece.h"
 
 #include "ConfigDescription.h"
@@ -148,7 +149,8 @@
   static bool FlattenUtf16(BigBuffer* out, const StringPool& pool);
 
   StringPool() = default;
-  StringPool(const StringPool&) = delete;
+  StringPool(StringPool&&) = default;
+  StringPool& operator=(StringPool&&) = default;
 
   /**
    * Adds a string to the pool, unless it already exists. Returns
@@ -208,6 +210,8 @@
   void Prune();
 
  private:
+  DISALLOW_COPY_AND_ASSIGN(StringPool);
+
   friend const_iterator begin(const StringPool& pool);
   friend const_iterator end(const StringPool& pool);