Chromium Code Reviews| Index: base/strings/utf_offset_string_conversions.h |
| diff --git a/base/strings/utf_offset_string_conversions.h b/base/strings/utf_offset_string_conversions.h |
| index 463772d51386b157ea01c8172ba16a39d4fa7517..2d0e09a87ba0df91167ec40104e24b9a9f0b5ebd 100644 |
| --- a/base/strings/utf_offset_string_conversions.h |
| +++ b/base/strings/utf_offset_string_conversions.h |
| @@ -49,6 +49,20 @@ class BASE_EXPORT OffsetAdjuster { |
| static void AdjustOffset(const Adjustments& adjustments, |
| size_t* offset); |
| + // Adjusts all offsets in |offsets_for_unadjustment| to reflect the reverse |
| + // of the adjustments recorded in |adjustments|. In other words, the offsets |
| + // provided represent offsets into an adjusted string and the caller wants |
| + // to know the offsets they correspond to in the original string. If an |
| + // offset cannot be successfully unadjusted (e.g., because it points into |
| + // the middle of a multibyte sequence), it will be set to string16::npos. |
| + static void UnadjustOffsets(const Adjustments& adjustments, |
| + std::vector<size_t>* offsets_for_unadjustment); |
| + |
| + // Adjusts the single |offset_for_unadjustment| to reflect the adjustments |
| + // recorded in |adjustments|. |
| + static void UnadjustOffset(const Adjustments& adjustments, |
| + size_t* offset_for_unadjustment); |
|
Peter Kasting
2014/04/23 23:18:01
Nit: Either name this |offset|, or name the arg to
Mark P
2014/04/24 14:05:02
Did the former.
|
| + |
| // Combines two sequential sets of adjustments, storing the combined revised |
| // adjustments in |adjustments_on_adjusted_string|. That is, suppose a |
| // string was altered in some way, with the alterations recorded as |