OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 String16WTF_h | 5 #ifndef String16WTF_h |
6 #define String16WTF_h | 6 #define String16WTF_h |
7 | 7 |
8 #include "platform/Decimal.h" | 8 #include "platform/Decimal.h" |
9 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
10 #include "wtf/text/StringBuilder.h" | 10 #include "wtf/text/StringBuilder.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bool endsWith(const String16& s) const { return m_impl.endsWith(s); } | 66 bool endsWith(const String16& s) const { return m_impl.endsWith(s); } |
67 bool endsWith(UChar character) const { return m_impl.endsWith(character); } | 67 bool endsWith(UChar character) const { return m_impl.endsWith(character); } |
68 | 68 |
69 private: | 69 private: |
70 WTF::String m_impl; | 70 WTF::String m_impl; |
71 }; | 71 }; |
72 | 72 |
73 class String16Builder { | 73 class String16Builder { |
74 public: | 74 public: |
75 String16Builder() { } | 75 String16Builder() { } |
76 void append(const String16& str) { m_impl.append(str); }; | 76 void append(const String16& str) { m_impl.append(StringView(str)); }; |
77 void append(UChar c) { m_impl.append(c); }; | 77 void append(UChar c) { m_impl.append(c); }; |
78 void append(LChar c) { m_impl.append(c); }; | 78 void append(LChar c) { m_impl.append(c); }; |
79 void append(char c) { m_impl.append(c); }; | 79 void append(char c) { m_impl.append(c); }; |
80 void append(const UChar* c, size_t size) { m_impl.append(c, size); }; | 80 void append(const UChar* c, size_t size) { m_impl.append(c, size); }; |
81 void append(const char* characters, unsigned length) { m_impl.append(charact
ers, length); } | 81 void append(const char* characters, unsigned length) { m_impl.append(charact
ers, length); } |
82 void appendNumber(int number) { m_impl.appendNumber(number); } | 82 void appendNumber(int number) { m_impl.appendNumber(number); } |
83 String16 toString() { return m_impl.toString(); } | 83 String16 toString() { return m_impl.toString(); } |
84 void reserveCapacity(unsigned newCapacity) { m_impl.reserveCapacity(newCapac
ity); } | 84 void reserveCapacity(unsigned newCapacity) { m_impl.reserveCapacity(newCapac
ity); } |
85 | 85 |
86 private: | 86 private: |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 template<> | 131 template<> |
132 struct HashTraits<String16> : SimpleClassHashTraits<String16> { | 132 struct HashTraits<String16> : SimpleClassHashTraits<String16> { |
133 static const bool hasIsEmptyValueFunction = true; | 133 static const bool hasIsEmptyValueFunction = true; |
134 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); } | 134 static bool isEmptyValue(const String16& a) { return a.impl().isNull(); } |
135 }; | 135 }; |
136 | 136 |
137 } // namespace WTF | 137 } // namespace WTF |
138 | 138 |
139 #endif // !defined(String16WTF_h) | 139 #endif // !defined(String16WTF_h) |
OLD | NEW |