OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 append(&c, 1); | 137 append(&c, 1); |
138 } | 138 } |
139 | 139 |
140 void append(LChar c) | 140 void append(LChar c) |
141 { | 141 { |
142 if (m_buffer && m_length < m_buffer->length() && m_string.isNull()) { | 142 if (m_buffer && m_length < m_buffer->length() && m_string.isNull()) { |
143 if (m_is8Bit) | 143 if (m_is8Bit) |
144 m_bufferCharacters8[m_length++] = c; | 144 m_bufferCharacters8[m_length++] = c; |
145 else | 145 else |
146 m_bufferCharacters16[m_length++] = c; | 146 m_bufferCharacters16[m_length++] = c; |
147 } else | 147 } else { |
148 append(&c, 1); | 148 append(&c, 1); |
| 149 } |
149 } | 150 } |
150 | 151 |
151 void append(char c) | 152 void append(char c) |
152 { | 153 { |
153 append(static_cast<LChar>(c)); | 154 append(static_cast<LChar>(c)); |
154 } | 155 } |
155 | 156 |
156 void append(UChar32 c) | 157 void append(UChar32 c) |
157 { | 158 { |
158 if (U_IS_BMP(c)) { | 159 if (U_IS_BMP(c)) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 inline bool operator==(const StringBuilder& a, const String& b) { return equal(a
, b); } | 394 inline bool operator==(const StringBuilder& a, const String& b) { return equal(a
, b); } |
394 inline bool operator!=(const StringBuilder& a, const String& b) { return !equal(
a, b); } | 395 inline bool operator!=(const StringBuilder& a, const String& b) { return !equal(
a, b); } |
395 inline bool operator==(const String& a, const StringBuilder& b) { return equal(b
, a); } | 396 inline bool operator==(const String& a, const StringBuilder& b) { return equal(b
, a); } |
396 inline bool operator!=(const String& a, const StringBuilder& b) { return !equal(
b, a); } | 397 inline bool operator!=(const String& a, const StringBuilder& b) { return !equal(
b, a); } |
397 | 398 |
398 } // namespace WTF | 399 } // namespace WTF |
399 | 400 |
400 using WTF::StringBuilder; | 401 using WTF::StringBuilder; |
401 | 402 |
402 #endif // StringBuilder_h | 403 #endif // StringBuilder_h |
OLD | NEW |