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 14 matching lines...) Expand all Loading... |
25 class StringUtil { | 25 class StringUtil { |
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 size_t find(const String& s, const char* needle) { |
| 36 return s.find(needle); |
| 37 } |
| 38 static size_t find(const String& s, const String& needle) { |
| 39 return s.find(needle); |
| 40 } |
35 static const size_t kNotFound = String::kNotFound; | 41 static const size_t kNotFound = String::kNotFound; |
36 static void builderAppend(StringBuilder& builder, const String& s) { | 42 static void builderAppend(StringBuilder& builder, const String& s) { |
37 builder.append(s); | 43 builder.append(s); |
38 } | 44 } |
39 static void builderAppend(StringBuilder& builder, UChar c) { | 45 static void builderAppend(StringBuilder& builder, UChar c) { |
40 builder.append(c); | 46 builder.append(c); |
41 } | 47 } |
42 static void builderAppend(StringBuilder& builder, const char* s, size_t len) { | 48 static void builderAppend(StringBuilder& builder, const char* s, size_t len) { |
43 builder.append(s, len); | 49 builder.append(s, len); |
44 } | 50 } |
(...skipping 30 matching lines...) Expand all Loading... |
75 explicit StringBufferImpl(String16&); | 81 explicit StringBufferImpl(String16&); |
76 String16 m_owner; | 82 String16 m_owner; |
77 StringView m_string; | 83 StringView m_string; |
78 | 84 |
79 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); | 85 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
80 }; | 86 }; |
81 | 87 |
82 } // namespace v8_inspector | 88 } // namespace v8_inspector |
83 | 89 |
84 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 90 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |