AAPT2: Define and Implement AAPT Container Format
AAPT Container Format (.apc) is a simple container that
enumerates the various intermediate files that AAPT2 generates
during the compile phase.
The format is defined in formats.md.
For now, continue using the .flat extension for the container file,
and keep making use of the .flata zip for storing multiple files.
This will allow easier integration with existing build systems and allow
the evolution of the APC format to better handle arbitrarily large
files.
Test: make aapt2_tests
Change-Id: Id7216e5b76316bdd683f0fa4eaf2d2da273ba815
diff --git a/tools/aapt2/io/File.h b/tools/aapt2/io/File.h
index 7ef6d88..f06e28c 100644
--- a/tools/aapt2/io/File.h
+++ b/tools/aapt2/io/File.h
@@ -43,6 +43,8 @@
// Returns nullptr on failure.
virtual std::unique_ptr<IData> OpenAsData() = 0;
+ virtual std::unique_ptr<io::InputStream> OpenInputStream() = 0;
+
// Returns the source of this file. This is for presentation to the user and
// may not be a valid file system path (for example, it may contain a '@' sign to separate
// the files within a ZIP archive from the path to the containing ZIP archive.
@@ -71,8 +73,11 @@
: file_(file), offset_(offset), len_(len) {}
std::unique_ptr<IData> OpenAsData() override;
+ std::unique_ptr<io::InputStream> OpenInputStream() override;
- const Source& GetSource() const override { return file_->GetSource(); }
+ const Source& GetSource() const override {
+ return file_->GetSource();
+ }
private:
DISALLOW_COPY_AND_ASSIGN(FileSegment);