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 String16_h | 5 #ifndef String16_h |
6 #define String16_h | 6 #define String16_h |
7 | 7 |
8 #include "platform/inspector_protocol/Collections.h" | 8 //#include "Collections.h" |
9 #include "platform/inspector_protocol/Platform.h" | 9 //#include "Platform.h" |
| 10 #include "{{export_macro_include}}" |
10 | 11 |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 namespace protocol { | 15 namespace protocol { |
15 | 16 |
16 namespace internal { | 17 namespace internal { |
17 PLATFORM_EXPORT void intToStr(int, char*, size_t); | 18 {{export_macro}} void intToStr(int, char*, size_t); |
18 PLATFORM_EXPORT void doubleToStr(double, char*, size_t); | 19 {{export_macro}} void doubleToStr(double, char*, size_t); |
19 PLATFORM_EXPORT void doubleToStr3(double, char*, size_t); | 20 {{export_macro}} void doubleToStr3(double, char*, size_t); |
20 PLATFORM_EXPORT void doubleToStr6(double, char*, size_t); | 21 {{export_macro}} void doubleToStr6(double, char*, size_t); |
21 PLATFORM_EXPORT double strToDouble(const char*, bool*); | 22 {{export_macro}} double strToDouble(const char*, bool*); |
22 PLATFORM_EXPORT int strToInt(const char*, bool*); | 23 {{export_macro}} int strToInt(const char*, bool*); |
23 } // namespace internal | 24 } // namespace internal |
24 | 25 |
25 template <typename T, typename C> | 26 template <typename T, typename C> |
26 class PLATFORM_EXPORT String16Base { | 27 class {{export_macro}} String16Base { |
27 public: | 28 public: |
28 static bool isASCII(C c) | 29 static bool isASCII(C c) |
29 { | 30 { |
30 return !(c & ~0x7F); | 31 return !(c & ~0x7F); |
31 } | 32 } |
32 | 33 |
33 static bool isSpaceOrNewLine(C c) | 34 static bool isSpaceOrNewLine(C c) |
34 { | 35 { |
35 return isASCII(c) ? c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)) : f
alse; | 36 return isASCII(c) ? c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)) : f
alse; |
36 } | 37 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (characters[i] != prefix[j]) | 145 if (characters[i] != prefix[j]) |
145 return false; | 146 return false; |
146 } | 147 } |
147 return true; | 148 return true; |
148 } | 149 } |
149 }; | 150 }; |
150 | 151 |
151 } // namespace protocol | 152 } // namespace protocol |
152 } // namespace blink | 153 } // namespace blink |
153 | 154 |
154 #if V8_INSPECTOR_USE_STL | 155 #include "{{string16_impl_h_include}}" |
155 #include "platform/inspector_protocol/String16STL.h" | |
156 #else | |
157 #include "platform/inspector_protocol/String16WTF.h" | |
158 #endif // V8_INSPECTOR_USE_STL | |
159 | 156 |
160 namespace blink { | 157 namespace blink { |
161 namespace protocol { | 158 namespace protocol { |
162 | 159 |
163 class PLATFORM_EXPORT String16Builder { | 160 class {{export_macro}} String16Builder { |
164 public: | 161 public: |
165 String16Builder(); | 162 String16Builder(); |
166 void append(const String16&); | 163 void append(const String16&); |
167 void append(UChar); | 164 void append(UChar); |
168 void append(char); | 165 void append(char); |
169 void append(const UChar*, size_t); | 166 void append(const UChar*, size_t); |
170 void append(const char*, size_t); | 167 void append(const char*, size_t); |
171 String16 toString(); | 168 String16 toString(); |
172 void reserveCapacity(size_t); | 169 void reserveCapacity(size_t); |
173 | 170 |
174 private: | 171 private: |
175 std::vector<UChar> m_buffer; | 172 std::vector<UChar> m_buffer; |
176 }; | 173 }; |
177 | 174 |
178 } // namespace protocol | 175 } // namespace protocol |
179 } // namespace blink | 176 } // namespace blink |
180 | 177 |
181 using String16 = blink::protocol::String16; | 178 using String16 = blink::protocol::String16; |
182 using String16Builder = blink::protocol::String16Builder; | 179 using String16Builder = blink::protocol::String16Builder; |
183 | 180 |
184 #endif // !defined(String16_h) | 181 #endif // !defined(String16_h) |
OLD | NEW |