diff options
author | Adam Lesinski <adamlesinski@google.com> | 2016-07-08 15:00:32 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2016-07-13 17:45:28 -0700 |
commit | d0f116b619feede0cfdb647157ce5ab4d50a1c46 (patch) | |
tree | 5b2a8663602ba2b267890ff85d3cf5618ac922b5 /tools/aapt2/java/AnnotationProcessor.cpp | |
parent | aaac91f4a00a9968ef107ea143e6f2f669f762f1 (diff) |
AAPT2: Remove usage of u16string
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
Diffstat (limited to 'tools/aapt2/java/AnnotationProcessor.cpp')
-rw-r--r-- | tools/aapt2/java/AnnotationProcessor.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/aapt2/java/AnnotationProcessor.cpp b/tools/aapt2/java/AnnotationProcessor.cpp index b7e7f903a2b1..23ff8abf8950 100644 --- a/tools/aapt2/java/AnnotationProcessor.cpp +++ b/tools/aapt2/java/AnnotationProcessor.cpp @@ -47,23 +47,13 @@ void AnnotationProcessor::appendCommentLine(std::string& comment) { mComment << "\n * " << std::move(comment); } -void AnnotationProcessor::appendComment(const StringPiece16& comment) { - // We need to process line by line to clean-up whitespace and append prefixes. - for (StringPiece16 line : util::tokenize(comment, u'\n')) { - line = util::trimWhitespace(line); - if (!line.empty()) { - std::string utf8Line = util::utf16ToUtf8(line); - appendCommentLine(utf8Line); - } - } -} - void AnnotationProcessor::appendComment(const StringPiece& comment) { + // We need to process line by line to clean-up whitespace and append prefixes. for (StringPiece line : util::tokenize(comment, '\n')) { line = util::trimWhitespace(line); if (!line.empty()) { - std::string utf8Line = line.toString(); - appendCommentLine(utf8Line); + std::string lineCopy = line.toString(); + appendCommentLine(lineCopy); } } } @@ -75,7 +65,7 @@ void AnnotationProcessor::appendNewLine() { void AnnotationProcessor::writeToStream(std::ostream* out, const StringPiece& prefix) const { if (mHasComments) { std::string result = mComment.str(); - for (StringPiece line : util::tokenize<char>(result, '\n')) { + for (StringPiece line : util::tokenize(result, '\n')) { *out << prefix << line << "\n"; } *out << prefix << " */" << "\n"; |