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

Side by Side Diff: Source/platform/text/SegmentedString.h

Issue 1308573006: [reland] SegmentedString::push() should always push a char in front (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding CORE_EXPORT per tasak@ suggestion Created 5 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
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 void close(); 183 void close();
184 184
185 void append(const SegmentedString&); 185 void append(const SegmentedString&);
186 void prepend(const SegmentedString&); 186 void prepend(const SegmentedString&);
187 187
188 bool excludeLineNumbers() const { return m_currentString.excludeLineNumbers( ); } 188 bool excludeLineNumbers() const { return m_currentString.excludeLineNumbers( ); }
189 void setExcludeLineNumbers(); 189 void setExcludeLineNumbers();
190 190
191 void push(UChar c) 191 void push(UChar c)
192 { 192 {
193 ASSERT(c);
194
193 if (!m_pushedChar1) { 195 if (!m_pushedChar1) {
194 m_pushedChar1 = c; 196 m_currentChar = m_pushedChar1 = c;
195 m_currentChar = m_pushedChar1 ? m_pushedChar1 : m_currentString.getC urrentChar();
196 updateSlowCaseFunctionPointers(); 197 updateSlowCaseFunctionPointers();
197 } else { 198 } else {
198 ASSERT(!m_pushedChar2); 199 ASSERT(!m_pushedChar2);
199 m_pushedChar2 = c; 200 m_pushedChar2 = m_pushedChar1;
201 m_currentChar = m_pushedChar1 = c;
200 } 202 }
201 } 203 }
202 204
203 bool isEmpty() const { return m_empty; } 205 bool isEmpty() const { return m_empty; }
204 unsigned length() const; 206 unsigned length() const;
205 207
206 bool isClosed() const { return m_closed; } 208 bool isClosed() const { return m_closed; }
207 209
208 enum LookAheadResult { 210 enum LookAheadResult {
209 DidNotMatch, 211 DidNotMatch,
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 bool m_closed; 419 bool m_closed;
418 bool m_empty; 420 bool m_empty;
419 unsigned char m_fastPathFlags; 421 unsigned char m_fastPathFlags;
420 void (SegmentedString::*m_advanceFunc)(); 422 void (SegmentedString::*m_advanceFunc)();
421 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)(); 423 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)();
422 }; 424 };
423 425
424 } 426 }
425 427
426 #endif 428 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698