summaryrefslogtreecommitdiff
path: root/tools/aapt2/io/FileSystem.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-10-20 19:15:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-10-20 19:15:54 +0000
commit7fd74b5ad1df53b92f08a9aa2f3d445bf7b786fe (patch)
tree03bbf941ec0fead1ad64ba2acd06113486a612c1 /tools/aapt2/io/FileSystem.cpp
parent4bf7416a062af25574f548846e60e88df332cc55 (diff)
parente59f0d80ec19249f72c07ae191ad673d040443e3 (diff)
Merge changes I1a4b3ce5,Id7216e5b
* changes: AAPT2: Enable building proto artifacts AAPT2: Define and Implement AAPT Container Format
Diffstat (limited to 'tools/aapt2/io/FileSystem.cpp')
-rw-r--r--tools/aapt2/io/FileSystem.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/aapt2/io/FileSystem.cpp b/tools/aapt2/io/FileSystem.cpp
index 027cbd041fa6..1387d2218ed4 100644
--- a/tools/aapt2/io/FileSystem.cpp
+++ b/tools/aapt2/io/FileSystem.cpp
@@ -20,11 +20,12 @@
#include "utils/FileMap.h"
#include "Source.h"
+#include "io/FileStream.h"
#include "util/Files.h"
#include "util/Maybe.h"
#include "util/Util.h"
-using android::StringPiece;
+using ::android::StringPiece;
namespace aapt {
namespace io {
@@ -42,12 +43,20 @@ std::unique_ptr<IData> RegularFile::OpenAsData() {
return {};
}
-const Source& RegularFile::GetSource() const { return source_; }
+std::unique_ptr<io::InputStream> RegularFile::OpenInputStream() {
+ return util::make_unique<FileInputStream>(source_.path);
+}
+
+const Source& RegularFile::GetSource() const {
+ return source_;
+}
FileCollectionIterator::FileCollectionIterator(FileCollection* collection)
: current_(collection->files_.begin()), end_(collection->files_.end()) {}
-bool FileCollectionIterator::HasNext() { return current_ != end_; }
+bool FileCollectionIterator::HasNext() {
+ return current_ != end_;
+}
IFile* FileCollectionIterator::Next() {
IFile* result = current_->second.get();