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

Side by Side Diff: ui/base/text/utf16_indexing.h

Issue 16431009: Use a direct include of strings headers in ui/, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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
« no previous file with comments | « ui/base/text/text_elider_unittest.cc ('k') | ui/base/touch/touch_factory_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_BASE_TEXT_UTF16_INDEXING_H_ 5 #ifndef UI_BASE_TEXT_UTF16_INDEXING_H_
6 #define UI_BASE_TEXT_UTF16_INDEXING_H_ 6 #define UI_BASE_TEXT_UTF16_INDEXING_H_
7 7
8 #include "base/string16.h" 8 #include "base/strings/string16.h"
9 #include "ui/base/ui_export.h" 9 #include "ui/base/ui_export.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 // Returns false if s[index-1] is a high surrogate and s[index] is a low 13 // Returns false if s[index-1] is a high surrogate and s[index] is a low
14 // surrogate, true otherwise. 14 // surrogate, true otherwise.
15 UI_EXPORT bool IsValidCodePointIndex(const string16& s, size_t index); 15 UI_EXPORT bool IsValidCodePointIndex(const string16& s, size_t index);
16 16
17 // |UTF16IndexToOffset| returns the number of code points between |base| and 17 // |UTF16IndexToOffset| returns the number of code points between |base| and
18 // |pos| in the given string. |UTF16OffsetToIndex| returns the index that is 18 // |pos| in the given string. |UTF16OffsetToIndex| returns the index that is
(...skipping 21 matching lines...) Expand all
40 UI_EXPORT ptrdiff_t UTF16IndexToOffset(const string16& s, 40 UI_EXPORT ptrdiff_t UTF16IndexToOffset(const string16& s,
41 size_t base, 41 size_t base,
42 size_t pos); 42 size_t pos);
43 UI_EXPORT size_t UTF16OffsetToIndex(const string16& s, 43 UI_EXPORT size_t UTF16OffsetToIndex(const string16& s,
44 size_t base, 44 size_t base,
45 ptrdiff_t offset); 45 ptrdiff_t offset);
46 46
47 } // namespace ui 47 } // namespace ui
48 48
49 #endif // UI_BASE_TEXT_UTF16_INDEXING_H_ 49 #endif // UI_BASE_TEXT_UTF16_INDEXING_H_
OLDNEW
« no previous file with comments | « ui/base/text/text_elider_unittest.cc ('k') | ui/base/touch/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698