chromium/v8/src/inspector/string-util.cc

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/inspector/string-util.h"

#include <cinttypes>
#include <cmath>
#include <cstddef>

#include "src/base/platform/platform.h"
#include "src/inspector/protocol/Protocol.h"
#include "src/numbers/conversions.h"

namespace v8_inspector {

namespace protocol {
namespace {
std::pair<uint8_t, uint8_t> SplitByte(uint8_t byte, uint8_t split) {}

v8::Maybe<uint8_t> DecodeByte(char byte) {}
}  // namespace

String Binary::toBase64() const {}

/* static */
Binary Binary::fromBase64(const String& base64, bool* success) {}
}  // namespace protocol

v8::Local<v8::String> toV8String(v8::Isolate* isolate, const String16& string) {}

v8::Local<v8::String> toV8StringInternalized(v8::Isolate* isolate,
                                             const String16& string) {}

v8::Local<v8::String> toV8StringInternalized(v8::Isolate* isolate,
                                             const char* str) {}

v8::Local<v8::String> toV8String(v8::Isolate* isolate,
                                 const StringView& string) {}

String16 toProtocolString(v8::Isolate* isolate, v8::Local<v8::String> value) {}

String16 toProtocolStringWithTypeCheck(v8::Isolate* isolate,
                                       v8::Local<v8::Value> value) {}

String16 toString16(const StringView& string) {}

StringView toStringView(const String16& string) {}

bool stringViewStartsWith(const StringView& string, const char* prefix) {}

namespace {
// An empty string buffer doesn't own any string data; its ::string() returns a
// default-constructed StringView instance.
class EmptyStringBuffer : public StringBuffer {};

// Contains LATIN1 text data or CBOR encoded binary data in a vector.
class StringBuffer8 : public StringBuffer {};

// Contains a 16 bit string (String16).
class StringBuffer16 : public StringBuffer {};
}  // namespace

// static
std::unique_ptr<StringBuffer> StringBuffer::create(StringView string) {}

std::unique_ptr<StringBuffer> StringBufferFrom(String16 str) {}

std::unique_ptr<StringBuffer> StringBufferFrom(std::vector<uint8_t> str) {}

String16 stackTraceIdToString(uintptr_t id) {}

}  // namespace v8_inspector

namespace v8_crdtp {

String16;
Binary;
StringUtil;

// static
bool ProtocolTypeTraits<String16>::Deserialize(DeserializerState* state,
                                               String16* value) {}

// static
void ProtocolTypeTraits<String16>::Serialize(const String16& value,
                                             std::vector<uint8_t>* bytes) {}

// static
bool ProtocolTypeTraits<Binary>::Deserialize(DeserializerState* state,
                                             Binary* value) {}

// static
void ProtocolTypeTraits<Binary>::Serialize(const Binary& value,
                                           std::vector<uint8_t>* bytes) {}

}  // namespace v8_crdtp