summaryrefslogtreecommitdiffstats
path: root/base/utf_offset_string_conversions.h
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 02:18:10 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 02:18:10 +0000
commitcbf35e1779dccff9941ad90c8e572d4c41fa7799 (patch)
tree5f9129d973c8bbaaf97864af0f8408fea74c2061 /base/utf_offset_string_conversions.h
parente4e7288fbbda34ea9219b0fdb157c5a67762710b (diff)
downloadchromium_src-cbf35e1779dccff9941ad90c8e572d4c41fa7799.zip
chromium_src-cbf35e1779dccff9941ad90c8e572d4c41fa7799.tar.gz
chromium_src-cbf35e1779dccff9941ad90c8e572d4c41fa7799.tar.bz2
Add UTF16ToUTF8AndAdjustOffset() to base/.
Currently, only UTF8ToUTF16 version is implemented. The converse version will be required for an upcoming patch for supporting input methods in PPAPI (crbug.com/59425), where WebKit strings (UTF16) with segmentation information must be converted to PPAPI strings (UTF8). BUG= TEST=base_unittests Review URL: http://codereview.chromium.org/7828092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/utf_offset_string_conversions.h')
-rw-r--r--base/utf_offset_string_conversions.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/utf_offset_string_conversions.h b/base/utf_offset_string_conversions.h
index 01177b6..c2faf3a 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,13 @@ BASE_EXPORT string16 UTF8ToUTF16AndAdjustOffsets(
const base::StringPiece& utf8,
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>