aboutsummaryrefslogtreecommitdiff
path: root/src/inspector/string-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/inspector/string-util.h')
-rw-r--r--src/inspector/string-util.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/inspector/string-util.h b/src/inspector/string-util.h
index e1a69e89..6f0e3d5f 100644
--- a/src/inspector/string-util.h
+++ b/src/inspector/string-util.h
@@ -5,6 +5,9 @@
#ifndef V8_INSPECTOR_STRINGUTIL_H_
#define V8_INSPECTOR_STRINGUTIL_H_
+#include <memory>
+
+#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/inspector/string-16.h"
@@ -29,15 +32,32 @@ class StringUtil {
return String::fromInteger(number);
}
static String fromDouble(double number) { return String::fromDouble(number); }
+ static size_t find(const String& s, const char* needle) {
+ return s.find(needle);
+ }
+ static size_t find(const String& s, const String& needle) {
+ return s.find(needle);
+ }
static const size_t kNotFound = String::kNotFound;
+ static void builderAppend(StringBuilder& builder, const String& s) {
+ builder.append(s);
+ }
+ static void builderAppend(StringBuilder& builder, UChar c) {
+ builder.append(c);
+ }
+ static void builderAppend(StringBuilder& builder, const char* s, size_t len) {
+ builder.append(s, len);
+ }
static void builderReserve(StringBuilder& builder, size_t capacity) {
builder.reserveCapacity(capacity);
}
+ static String builderToString(StringBuilder& builder) {
+ return builder.toString();
+ }
+ static std::unique_ptr<protocol::Value> parseJSON(const String16& json);
+ static std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
};
-std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
-std::unique_ptr<protocol::Value> parseJSON(const String16& json);
-
} // namespace protocol
v8::Local<v8::String> toV8String(v8::Isolate*, const String16&);