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

Side by Side Diff: base/strings/utf_offset_string_conversions.cc

Issue 13374002: base: Update the include paths of base/string_piece.h to its new location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/utf_offset_string_conversions.h" 5 #include "base/strings/utf_offset_string_conversions.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_piece.h" 10 #include "base/strings/string_piece.h"
11 #include "base/strings/utf_string_conversion_utils.h" 11 #include "base/strings/utf_string_conversion_utils.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 // Converts the given source Unicode character type to the given destination 15 // Converts the given source Unicode character type to the given destination
16 // Unicode character type as a STL string. The given input buffer and size 16 // Unicode character type as a STL string. The given input buffer and size
17 // determine the source, and the given output STL string will be replaced by 17 // determine the source, and the given output STL string will be replaced by
18 // the result. 18 // the result.
19 template<typename SrcChar, typename DestStdString> 19 template<typename SrcChar, typename DestStdString>
20 bool ConvertUnicode(const SrcChar* src, 20 bool ConvertUnicode(const SrcChar* src,
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (*offset < (i->original_offset + i->original_length)) { 157 if (*offset < (i->original_offset + i->original_length)) {
158 *offset = string16::npos; 158 *offset = string16::npos;
159 return; 159 return;
160 } 160 }
161 adjustment += (i->original_length - i->output_length); 161 adjustment += (i->original_length - i->output_length);
162 } 162 }
163 *offset -= adjustment; 163 *offset -= adjustment;
164 } 164 }
165 165
166 } // namespace base 166 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/utf_offset_string_conversions.h ('k') | base/strings/utf_offset_string_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698