OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef InspectorProtocolString_h |
| 6 #define InspectorProtocolString_h |
| 7 |
| 8 #include "platform/v8_inspector/String16.h" |
| 9 |
| 10 namespace v8_inspector { |
| 11 namespace protocol { |
| 12 |
| 13 using String = v8_inspector::String16; |
| 14 using StringBuilder = v8_inspector::String16Builder; |
| 15 |
| 16 class PLATFORM_EXPORT StringUtil { |
| 17 public: |
| 18 static String substring(const String& s, unsigned pos, unsigned len = UINT_M
AX) { return s.substring(pos, len); } |
| 19 static String fromInteger(int number) { return String::fromInteger(number);
} |
| 20 static String fromDouble(double number) { return String::fromDouble(number);
} |
| 21 static const size_t kNotFound = String::kNotFound; |
| 22 static void toCharacters(const String& s, const UChar** characters, size_t*
length) |
| 23 { |
| 24 *characters = s.characters16(); |
| 25 *length = s.length(); |
| 26 } |
| 27 static void builderReserve(StringBuilder& builder, unsigned capacity) { buil
der.reserveCapacity(capacity); } |
| 28 }; |
| 29 |
| 30 } // namespace protocol |
| 31 } // namespace v8_inspector |
| 32 |
| 33 #endif // !defined(InspectorProtocolString_h) |
OLD | NEW |