mirror of
https://github.com/electron/electron.git
synced 2026-02-14 00:55:19 -05:00
Add converter for const char*.
This commit is contained in:
@@ -103,6 +103,11 @@ bool Converter<double>::FromV8(Isolate* isolate, Handle<Value> val,
|
||||
return true;
|
||||
}
|
||||
|
||||
Handle<Value> Converter<const char*>::ToV8(
|
||||
Isolate* isolate, const char* val) {
|
||||
return MATE_STRING_NEW_FROM_UTF8(isolate, val, -1);
|
||||
}
|
||||
|
||||
Handle<Value> Converter<base::StringPiece>::ToV8(
|
||||
Isolate* isolate, const base::StringPiece& val) {
|
||||
return MATE_STRING_NEW_FROM_UTF8(isolate, val.data(),
|
||||
|
||||
@@ -88,6 +88,11 @@ struct Converter<double> {
|
||||
double* out);
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Converter<const char*> {
|
||||
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, const char* val);
|
||||
};
|
||||
|
||||
template<>
|
||||
struct Converter<base::StringPiece> {
|
||||
static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
|
||||
Reference in New Issue
Block a user