forked from CopernicaMarketingSoftware/PHP-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
value.h
48 lines (42 loc) · 833 Bytes
/
value.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* value.h
*
* Simple value casting functions for casting values
* between php and ecmascript runtime values.
*
* @copyright 2015 Copernica B.V.
*/
/**
* Include guard
*/
#pragma once
/**
* Dependencies
*/
#include <phpcpp.h>
#include <v8.h>
/**
* Start namespace
*/
namespace JS {
/**
* Cast a PHP runtime value to an ecmascript value
*
* @param value the value to cast
* @return v8::Handle<v8::Value>
*/
v8::Handle<v8::Value> value(const Php::Value &value);
/**
* Cast an ecmascript value to a PHP runtime value
*
* @note The value cannot be const, as retrieving properties
* from arrays and objects cannot be done on const values
*
* @param value the value to cast
* @return Php::Value
*/
Php::Value value(v8::Handle<v8::Value> value);
/**
* End namespace
*/
}