Index: src/core/SkString.cpp |
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp |
index ba1da4136893dffcbc5e1ac8252d9e3a4118a977..aeff325dca202a04d8e4b395092d960eef17aed9 100644 |
--- a/src/core/SkString.cpp |
+++ b/src/core/SkString.cpp |
@@ -555,6 +555,17 @@ void SkString::insertScalar(size_t offset, SkScalar value) { |
this->insert(offset, buffer, stop - buffer); |
} |
+void SkString::replace_char(const char oldChar, const char newChar) { |
+ if (this->isEmpty()) { |
+ return; |
+ } |
+ for (size_t i = 0; i < this->size(); ++i) { |
+ if (oldChar == this->operator[](i)) { |
epoger
2014/06/11 11:01:33
Instead of going through the [] operator, I suspec
rs.prinja
2014/06/11 12:08:03
Done, although since unsigned always compares as >
|
+ fRec->data()[i] = newChar; |
+ } |
+ } |
+} |
+ |
void SkString::printf(const char format[], ...) { |
char buffer[kBufferSize]; |
ARGS_TO_BUFFER(format, buffer, kBufferSize); |