From a693c4a32ebed4e96dcc1cf6a706e8ebbb004db2 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 9 Nov 2017 11:29:39 -0800 Subject: AAPT2: Move all file output to FileOutputStream FileOutputStream is safe to use on Windows, as it opens files using our compatibility API. Bug: 68262818 Test: make aapt2_tests Change-Id: Ib0b27e93edd609b49b1327db7d9867a002198ebb --- tools/aapt2/java/JavaClassGenerator.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tools/aapt2/java/JavaClassGenerator.h') diff --git a/tools/aapt2/java/JavaClassGenerator.h b/tools/aapt2/java/JavaClassGenerator.h index 2541749750a6..4992f077c566 100644 --- a/tools/aapt2/java/JavaClassGenerator.h +++ b/tools/aapt2/java/JavaClassGenerator.h @@ -17,16 +17,16 @@ #ifndef AAPT_JAVA_CLASS_GENERATOR_H #define AAPT_JAVA_CLASS_GENERATOR_H -#include #include #include "androidfw/StringPiece.h" #include "ResourceTable.h" #include "ResourceValues.h" -#include "androidfw/StringPiece.h" +#include "io/Io.h" #include "process/IResourceTableConsumer.h" #include "process/SymbolTable.h" +#include "text/Printer.h" namespace aapt { @@ -70,14 +70,14 @@ class JavaClassGenerator { // All symbols technically belong to a single package, but linked libraries will // have their names mangled, denoting that they came from a different package. // We need to generate these symbols in a separate file. Returns true on success. - bool Generate(const android::StringPiece& package_name_to_generate, std::ostream* out, - std::ostream* out_r_txt = nullptr); + bool Generate(const android::StringPiece& package_name_to_generate, io::OutputStream* out, + io::OutputStream* out_r_txt = nullptr); bool Generate(const android::StringPiece& package_name_to_generate, - const android::StringPiece& output_package_name, std::ostream* out, - std::ostream* out_r_txt = nullptr); + const android::StringPiece& output_package_name, io::OutputStream* out, + io::OutputStream* out_r_txt = nullptr); - const std::string& getError() const; + const std::string& GetError() const; static std::string TransformToFieldName(const android::StringPiece& symbol); @@ -94,13 +94,13 @@ class JavaClassGenerator { bool ProcessType(const android::StringPiece& package_name_to_generate, const ResourceTablePackage& package, const ResourceTableType& type, ClassDefinition* out_type_class_def, MethodDefinition* out_rewrite_method_def, - std::ostream* out_r_txt); + text::Printer* r_txt_printer); // Writes a resource to the R.java file, optionally writing out a rewrite rule for its package // ID if `out_rewrite_method` is not nullptr. void ProcessResource(const ResourceNameRef& name, const ResourceId& id, const ResourceEntry& entry, ClassDefinition* out_class_def, - MethodDefinition* out_rewrite_method, std::ostream* out_r_txt); + MethodDefinition* out_rewrite_method, text::Printer* r_txt_printer); // Writes a styleable resource to the R.java file, optionally writing out a rewrite rule for // its package ID if `out_rewrite_method` is not nullptr. @@ -109,7 +109,7 @@ class JavaClassGenerator { const Styleable& styleable, const android::StringPiece& package_name_to_generate, ClassDefinition* out_class_def, MethodDefinition* out_rewrite_method, - std::ostream* out_r_txt); + text::Printer* r_txt_printer); IAaptContext* context_; ResourceTable* table_; @@ -117,7 +117,7 @@ class JavaClassGenerator { std::string error_; }; -inline const std::string& JavaClassGenerator::getError() const { +inline const std::string& JavaClassGenerator::GetError() const { return error_; } -- cgit v1.2.3