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

Side by Side Diff: ui/gfx/utf16_indexing.h

Issue 1543183002: Switch to standard integer types in ui/gfx/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « ui/gfx/transform_util_unittest.cc ('k') | ui/gfx/utf16_indexing_unittest.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_GFX_UTF16_INDEXING_H_ 5 #ifndef UI_GFX_UTF16_INDEXING_H_
6 #define UI_GFX_UTF16_INDEXING_H_ 6 #define UI_GFX_UTF16_INDEXING_H_
7 7
8 #include <stddef.h>
9
8 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
9 #include "ui/gfx/gfx_export.h" 11 #include "ui/gfx/gfx_export.h"
10 12
11 namespace gfx { 13 namespace gfx {
12 14
13 // Returns false if s[index-1] is a high surrogate and s[index] is a low 15 // Returns false if s[index-1] is a high surrogate and s[index] is a low
14 // surrogate, true otherwise. 16 // surrogate, true otherwise.
15 GFX_EXPORT bool IsValidCodePointIndex(const base::string16& s, size_t index); 17 GFX_EXPORT bool IsValidCodePointIndex(const base::string16& s, size_t index);
16 18
17 // |UTF16IndexToOffset| returns the number of code points between |base| and 19 // |UTF16IndexToOffset| returns the number of code points between |base| and
(...skipping 22 matching lines...) Expand all
40 GFX_EXPORT ptrdiff_t UTF16IndexToOffset(const base::string16& s, 42 GFX_EXPORT ptrdiff_t UTF16IndexToOffset(const base::string16& s,
41 size_t base, 43 size_t base,
42 size_t pos); 44 size_t pos);
43 GFX_EXPORT size_t UTF16OffsetToIndex(const base::string16& s, 45 GFX_EXPORT size_t UTF16OffsetToIndex(const base::string16& s,
44 size_t base, 46 size_t base,
45 ptrdiff_t offset); 47 ptrdiff_t offset);
46 48
47 } // namespace gfx 49 } // namespace gfx
48 50
49 #endif // UI_GFX_UTF16_INDEXING_H_ 51 #endif // UI_GFX_UTF16_INDEXING_H_
OLDNEW
« no previous file with comments | « ui/gfx/transform_util_unittest.cc ('k') | ui/gfx/utf16_indexing_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698