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) { | |
dgozman
2017/02/03 20:43:39
Let's also have |const String& needle| version.
Łukasz Anforowicz
2017/02/03 21:56:21
Done.
| |
36 return s.find(needle); | |
37 } | |
35 static const size_t kNotFound = String::kNotFound; | 38 static const size_t kNotFound = String::kNotFound; |
36 static void builderAppend(StringBuilder& builder, const String& s) { | 39 static void builderAppend(StringBuilder& builder, const String& s) { |
37 builder.append(s); | 40 builder.append(s); |
38 } | 41 } |
39 static void builderAppend(StringBuilder& builder, UChar c) { | 42 static void builderAppend(StringBuilder& builder, UChar c) { |
40 builder.append(c); | 43 builder.append(c); |
41 } | 44 } |
42 static void builderAppend(StringBuilder& builder, const char* s, size_t len) { | 45 static void builderAppend(StringBuilder& builder, const char* s, size_t len) { |
43 builder.append(s, len); | 46 builder.append(s, len); |
44 } | 47 } |
(...skipping 30 matching lines...) Expand all Loading... | |
75 explicit StringBufferImpl(String16&); | 78 explicit StringBufferImpl(String16&); |
76 String16 m_owner; | 79 String16 m_owner; |
77 StringView m_string; | 80 StringView m_string; |
78 | 81 |
79 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); | 82 DISALLOW_COPY_AND_ASSIGN(StringBufferImpl); |
80 }; | 83 }; |
81 | 84 |
82 } // namespace v8_inspector | 85 } // namespace v8_inspector |
83 | 86 |
84 #endif // V8_INSPECTOR_STRINGUTIL_H_ | 87 #endif // V8_INSPECTOR_STRINGUTIL_H_ |
OLD | NEW |