| 15 | }; |
| 16 | |
| 17 | struct V8Value : V8ValueBase |
| 18 | { |
| 19 | inline bool isUndefined() { return _.is_undefined(&_); } |
| 20 | inline bool isNull() { return _.is_null(&_); } |
| 21 | |
| 22 | inline bool isBool() { return _.is_bool(&_); } |
| 23 | inline bool isInt() { return _.is_int(&_); } |
| 24 | inline bool isUint() { return _.is_uint(&_); } |
| 25 | inline bool isDouble() { return _.is_double(&_); } |
| 26 | inline bool isString() { return _.is_string(&_); } |
| 27 | inline bool isObject() { return _.is_object(&_); } |
| 28 | inline bool isArray() { return _.is_array(&_); } |
| 29 | inline bool isFunction() { return _.is_function(&_); } |
| 30 | |
| 31 | inline bool asBool() { return _.get_bool_value(&_); } |
| 32 | inline int asInt() { return _.get_int_value(&_); } |
| 33 | inline uint32_t asUint() { return _.get_uint_value(&_); } |
| 34 | inline double asDouble() { return _.get_double_value(&_); } |
| 35 | inline cef_string_userfree_t asString() { return _.get_string_value(&_); } |
| 36 | |
| 37 | inline struct V8Array *asArray() { return reinterpret_cast<struct V8Array *>(&_); } |
| 38 | inline struct V8Object *asObject() { return reinterpret_cast<struct V8Object *>(&_); } |
| 39 | |
| 40 | static inline V8Value *undefined() |
| 41 | { |
| 42 | return (V8Value *)cef_v8value_create_undefined(); |
| 43 | } |
| 44 | |
| 45 | static inline V8Value *null() |
| 46 | { |
| 47 | return (V8Value *)cef_v8value_create_null(); |
| 48 | } |
| 49 | |
| 50 | static inline V8Value *boolean(bool value) |
| 51 | { |
| 52 | return (V8Value *)cef_v8value_create_bool(value); |
| 53 | } |
| 54 | |
| 55 | static inline V8Value *number(double value) |
| 56 | { |
| 57 | return (V8Value *)cef_v8value_create_double(value); |
| 58 | } |
| 59 | |
| 60 | static inline V8Value *number(int value) |
| 61 | { |
| 62 | return (V8Value *)cef_v8value_create_int(value); |
| 63 | } |
| 64 | |
| 65 | static inline V8Value *string(const cef_string_t *value) |
| 66 | { |
| 67 | return (V8Value *)cef_v8value_create_string(value); |
| 68 | } |
| 69 | |
| 70 | static inline V8Value *function(const cef_string_t *name, cef_v8handler_t *handler) |
| 71 | { |
| 72 | return (V8Value *)cef_v8value_create_function(name, handler); |
| 73 | } |
| 74 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected