Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: base/utf_offset_string_conversions.h

Issue 7828092: Add UTF16ToUTF8AndAdjustOffset() to base/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/utf_offset_string_conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/utf_offset_string_conversions.h
diff --git a/base/utf_offset_string_conversions.h b/base/utf_offset_string_conversions.h
index 01177b655dc2d1d94139c1cdfdd8be94dd6c33b8..e294711182f4e6298dd6f33183930c8cb8876ef0 100644
--- a/base/utf_offset_string_conversions.h
+++ b/base/utf_offset_string_conversions.h
@@ -14,6 +14,7 @@
namespace base {
class StringPiece;
+class StringPiece16;
}
// Like the conversions in utf_string_conversions.h, but also takes one or more
@@ -38,6 +39,24 @@ BASE_EXPORT string16 UTF8ToUTF16AndAdjustOffsets(
const base::StringPiece& utf8,
std::vector<size_t>* offsets_for_adjustment);
+BASE_EXPORT bool UTF16ToUTF8AndAdjustOffset(const char16* src,
brettw 2011/09/06 18:19:18 I'd not bother with these first two variants and j
kinaba 2011/09/06 23:55:36 Done.
+ size_t src_len,
+ std::string* output,
+ size_t* offset_for_adjustment);
+BASE_EXPORT bool UTF16ToUTF8AndAdjustOffsets(
+ const char16* src,
+ size_t src_len,
+ std::string* output,
+ std::vector<size_t>* offsets_for_adjustment);
+
+BASE_EXPORT std::string UTF16ToUTF8AndAdjustOffset(
+ const base::StringPiece16& utf16,
+ size_t* offset_for_adjustment);
+BASE_EXPORT std::string UTF16ToUTF8AndAdjustOffsets(
+ const base::StringPiece16& utf16,
+ std::vector<size_t>* offsets_for_adjustment);
+
+
// Limiting function callable by std::for_each which will replace any value
// which is equal to or greater than |limit| with npos.
template <typename T>
« no previous file with comments | « no previous file | base/utf_offset_string_conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698