diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-11-09 11:29:39 -0800 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2017-11-16 12:06:17 -0800 |
commit | a693c4a32ebed4e96dcc1cf6a706e8ebbb004db2 (patch) | |
tree | 902f4d5abd493ccb8087b941676e2562c8db128b /tools/aapt2/java/JavaClassGenerator.h | |
parent | 60303333dc8ad61e640992cee2b5c601be73faf8 (diff) |
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
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.h')
-rw-r--r-- | tools/aapt2/java/JavaClassGenerator.h | 22 |
1 files changed, 11 insertions, 11 deletions
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 <ostream> #include <string> #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_; } |