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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void append(UChar32 c) | 134 void append(UChar32 c) |
135 { | 135 { |
136 if (U_IS_BMP(c)) { | 136 if (U_IS_BMP(c)) { |
137 append(static_cast<UChar>(c)); | 137 append(static_cast<UChar>(c)); |
138 return; | 138 return; |
139 } | 139 } |
140 append(U16_LEAD(c)); | 140 append(U16_LEAD(c)); |
141 append(U16_TRAIL(c)); | 141 append(U16_TRAIL(c)); |
142 } | 142 } |
143 | 143 |
| 144 template<unsigned charactersCount> |
| 145 ALWAYS_INLINE void appendLiteral(const char (&characters)[charactersCount])
{ append(characters, charactersCount - 1); } |
| 146 |
144 void appendNumber(int); | 147 void appendNumber(int); |
145 void appendNumber(unsigned); | 148 void appendNumber(unsigned); |
146 void appendNumber(long); | 149 void appendNumber(long); |
147 void appendNumber(unsigned long); | 150 void appendNumber(unsigned long); |
148 void appendNumber(long long); | 151 void appendNumber(long long); |
149 void appendNumber(unsigned long long); | 152 void appendNumber(unsigned long long); |
150 void appendNumber(double, unsigned precision = 6, TrailingZerosTruncatingPol
icy = TruncateTrailingZeros); | 153 void appendNumber(double, unsigned precision = 6, TrailingZerosTruncatingPol
icy = TruncateTrailingZeros); |
151 | 154 |
152 String toString() | 155 String toString() |
153 { | 156 { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 inline bool operator==(const StringBuilder& a, const String& b) { return equal(a
, b); } | 371 inline bool operator==(const StringBuilder& a, const String& b) { return equal(a
, b); } |
369 inline bool operator!=(const StringBuilder& a, const String& b) { return !equal(
a, b); } | 372 inline bool operator!=(const StringBuilder& a, const String& b) { return !equal(
a, b); } |
370 inline bool operator==(const String& a, const StringBuilder& b) { return equal(b
, a); } | 373 inline bool operator==(const String& a, const StringBuilder& b) { return equal(b
, a); } |
371 inline bool operator!=(const String& a, const StringBuilder& b) { return !equal(
b, a); } | 374 inline bool operator!=(const String& a, const StringBuilder& b) { return !equal(
b, a); } |
372 | 375 |
373 } // namespace WTF | 376 } // namespace WTF |
374 | 377 |
375 using WTF::StringBuilder; | 378 using WTF::StringBuilder; |
376 | 379 |
377 #endif // StringBuilder_h | 380 #endif // StringBuilder_h |
OLD | NEW |