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/AnnotationProcessor.cpp | |
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/AnnotationProcessor.cpp')
-rw-r--r-- | tools/aapt2/java/AnnotationProcessor.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/aapt2/java/AnnotationProcessor.cpp b/tools/aapt2/java/AnnotationProcessor.cpp index c93461a66899..8d91b0098c1f 100644 --- a/tools/aapt2/java/AnnotationProcessor.cpp +++ b/tools/aapt2/java/AnnotationProcessor.cpp @@ -23,6 +23,7 @@ #include "text/Utf8Iterator.h" #include "util/Util.h" +using ::aapt::text::Printer; using ::aapt::text::Utf8Iterator; using ::android::StringPiece; @@ -109,23 +110,22 @@ void AnnotationProcessor::AppendNewLine() { } } -void AnnotationProcessor::WriteToStream(const StringPiece& prefix, std::ostream* out) const { +void AnnotationProcessor::Print(Printer* printer) const { if (has_comments_) { std::string result = comment_.str(); for (StringPiece line : util::Tokenize(result, '\n')) { - *out << prefix << line << "\n"; + printer->Println(line); } - *out << prefix << " */" - << "\n"; + printer->Println(" */"); } if (annotation_bit_mask_ & AnnotationRule::kDeprecated) { - *out << prefix << "@Deprecated\n"; + printer->Println("@Deprecated"); } for (const AnnotationRule& rule : sAnnotationRules) { if (annotation_bit_mask_ & rule.bit_mask) { - *out << prefix << rule.annotation << "\n"; + printer->Println(rule.annotation); } } } |