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

Side by Side Diff: base/i18n/break_iterator.h

Issue 7841056: fix know issues in RenderText (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 | « no previous file | base/i18n/break_iterator.cc » ('j') | ui/gfx/render_text.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef BASE_I18N_BREAK_ITERATOR_H_ 5 #ifndef BASE_I18N_BREAK_ITERATOR_H_
6 #define BASE_I18N_BREAK_ITERATOR_H_ 6 #define BASE_I18N_BREAK_ITERATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // character in the string, and when we advance to that position it's the 81 // character in the string, and when we advance to that position it's the
82 // last time Advance() returns true.) 82 // last time Advance() returns true.)
83 bool Advance(); 83 bool Advance();
84 84
85 // Under BREAK_WORD mode, returns true if the break we just hit is the 85 // Under BREAK_WORD mode, returns true if the break we just hit is the
86 // end of a word. (Otherwise, the break iterator just skipped over e.g. 86 // end of a word. (Otherwise, the break iterator just skipped over e.g.
87 // whitespace or punctuation.) Under BREAK_LINE and BREAK_NEWLINE modes, 87 // whitespace or punctuation.) Under BREAK_LINE and BREAK_NEWLINE modes,
88 // this distinction doesn't apply and it always retuns false. 88 // this distinction doesn't apply and it always retuns false.
89 bool IsWord() const; 89 bool IsWord() const;
90 90
91 // Under BREAK_WORD mode, returns true if |position| is at the end of word or
92 // at the start of word. It always retuns false Under BREAK_LINE and
93 // BREAK_NEWLINE modes,
msw 2011/09/09 23:03:24 use a period instead of a comma at the end of this
xji 2011/09/12 21:31:48 Done.
94 bool IsEndOfWord(size_t position) const;
95 bool IsStartOfWord(size_t position) const;
96
91 // Returns the string between prev() and pos(). 97 // Returns the string between prev() and pos().
92 // Advance() must have been called successfully at least once for pos() to 98 // Advance() must have been called successfully at least once for pos() to
93 // have advanced to somewhere useful. 99 // have advanced to somewhere useful.
94 string16 GetString() const; 100 string16 GetString() const;
95 101
96 // Returns the value of pos() returned before Advance() was last called. 102 // Returns the value of pos() returned before Advance() was last called.
97 size_t prev() const { return prev_; } 103 size_t prev() const { return prev_; }
98 104
99 // Returns the current break position within the string, 105 // Returns the current break position within the string,
100 // or BreakIterator::npos when done. 106 // or BreakIterator::npos when done.
(...skipping 15 matching lines...) Expand all
116 // Previous and current iterator positions. 122 // Previous and current iterator positions.
117 size_t prev_, pos_; 123 size_t prev_, pos_;
118 124
119 DISALLOW_COPY_AND_ASSIGN(BreakIterator); 125 DISALLOW_COPY_AND_ASSIGN(BreakIterator);
120 }; 126 };
121 127
122 } // namespace i18n 128 } // namespace i18n
123 } // namespace base 129 } // namespace base
124 130
125 #endif // BASE_I18N_BREAK_ITERATOR_H_ 131 #endif // BASE_I18N_BREAK_ITERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | base/i18n/break_iterator.cc » ('j') | ui/gfx/render_text.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698