OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 V8_INSPECTOR_STRINGUTIL_H_ | 5 #ifndef V8_INSPECTOR_STRINGUTIL_H_ |
6 #define V8_INSPECTOR_STRINGUTIL_H_ | 6 #define V8_INSPECTOR_STRINGUTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 static String substring(const String& s, size_t pos, size_t len) { | 27 static String substring(const String& s, size_t pos, size_t len) { |
28 return s.substring(pos, len); | 28 return s.substring(pos, len); |
29 } | 29 } |
30 static String fromInteger(int number) { return String::fromInteger(number); } | 30 static String fromInteger(int number) { return String::fromInteger(number); } |
31 static String fromInteger(size_t number) { | 31 static String fromInteger(size_t number) { |
32 return String::fromInteger(number); | 32 return String::fromInteger(number); |
33 } | 33 } |
34 static String fromDouble(double number) { return String::fromDouble(number); } | 34 static String fromDouble(double number) { return String::fromDouble(number); } |
35 static const size_t kNotFound = String::kNotFound; | 35 static const size_t kNotFound = String::kNotFound; |
| 36 static void builderAppend(StringBuilder& builder, const String& s) { |
| 37 builder.append(s); |
| 38 } |
| 39 static void builderAppend(StringBuilder& builder, UChar c) { |
| 40 builder.append(c); |
| 41 } |
| 42 static void builderAppend(StringBuilder& builder, const char* s, size_t len) { |
| 43 builder.append(s, len); |
| 44 } |
36 static void builderReserve(StringBuilder& builder, size_t capacity) { | 45 static void builderReserve(StringBuilder& builder, size_t capacity) { |
37 builder.reserveCapacity(capacity); | 46 builder.reserveCapacity(capacity); |
38 } | 47 } |
| 48 static String builderToString(StringBuilder& builder) { |
| 49 return builder.toString(); |
| 50 } |
39 static std::unique_ptr<protocol::Value> parseJSON(const String16& json); | 51 static std::unique_ptr<protocol::Value> parseJSON(const String16& json); |
40 static std::unique_ptr<protocol::Value> parseJSON(const StringView& json); | 52 static std::unique_ptr<protocol::Value> parseJSON(const StringView& json); |
41 }; | 53 }; |
42 | 54 |
43 } // namespace protocol | 55 } // namespace protocol |
44 | 56 |
45 v8::Local<v8::String> toV8String(v8::Isolate*, const String16&); | 57 v8::Local<v8::String> toV8String(v8::Isolate*, const String16&); |
46 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const String16&); | 58 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const String16&); |
47 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); | 59 v8::Local<v8::String> toV8StringInternalized(v8::Isolate*, const char*); |
48 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); | 60 v8::Local<v8::String> toV8String(v8::Isolate*, const StringView&); |
(...skipping 14 matching lines...) Expand all Loading... |
63 explicit StringBufferImpl(String16&); | 75 explicit StringBufferImpl(String16&); |
64 String16 m_owner; | 76 String16 m_owner; |
65 StringView m_string; | 77 StringView m_string; |
66 | 78 |
67 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); | 79 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
68 }; | 80 }; |
69 | 81 |
70 } // namespace v8_inspector | 82 } // namespace v8_inspector |
71 | 83 |
72 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 84 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |