MCPcopy Create free account
hub / github.com/NativeScript/android / ToString

Method ToString

test-app/runtime/src/main/cpp/ArgConverter.h:72–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 inline static std::string ToString(v8::Isolate *isolate, const v8::Local<v8::Value> &value) {
73 if (value.IsEmpty()) {
74 return std::string();
75 }
76
77 if (value->IsStringObject()) {
78 v8::Local<v8::String> obj = value.As<v8::StringObject>()->ValueOf();
79 return ToString(isolate, obj);
80 }
81
82 v8::String::Utf8Value result(isolate, value);
83
84 const char *val = *result;
85 if (val == nullptr) {
86 return std::string();
87 }
88
89 return std::string(*result, result.length());
90 }
91
92
93 static std::u16string ConvertToUtf16String(const v8::Local<v8::String>& s);

Callers

nothing calls this directly

Calls 3

ToStringFunction · 0.85
IsEmptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected