5 #ifndef PPAPI_CPP_VAR_H_
6 #define PPAPI_CPP_VAR_H_
13 #include "ppapi/c/pp_var.h"
51 Var(
const char* utf8_str);
54 Var(
const std::string& utf8_str);
70 explicit Var(
const PP_Var& var);
110 bool is_undefined()
const {
return var_.type == PP_VARTYPE_UNDEFINED; }
115 bool is_null()
const {
return var_.type == PP_VARTYPE_NULL; }
120 bool is_bool()
const {
return var_.type == PP_VARTYPE_BOOL; }
125 bool is_string()
const {
return var_.type == PP_VARTYPE_STRING; }
130 bool is_object()
const {
return var_.type == PP_VARTYPE_OBJECT; }
135 bool is_array()
const {
return var_.type == PP_VARTYPE_ARRAY; }
145 bool is_resource()
const {
return var_.type == PP_VARTYPE_RESOURCE; }
155 bool is_int()
const {
return var_.type == PP_VARTYPE_INT32; }
165 bool is_double()
const {
return var_.type == PP_VARTYPE_DOUBLE; }
172 return var_.type == PP_VARTYPE_INT32 ||
173 var_.type == PP_VARTYPE_DOUBLE;
197 int32_t
AsInt()
const;
241 var_ = PP_MakeUndefined();
284 temp_ = output_->var_;
287 temp_.type = PP_VARTYPE_UNDEFINED;
293 if (output_ && !originally_had_exception_)
294 *output_ =
Var(PASS_REF, temp_);
305 bool originally_had_exception_;
320 Var(
void* non_scriptable_object_pointer);
325 #endif // PPAPI_CPP_VAR_H_
bool is_array_buffer() const
This function determines if this Var is an ArrayBuffer.
Definition: var.h:177
bool is_number() const
Definition: var.h:171
PP_Var Detach()
Definition: var.h:239
std::string DebugString() const
bool is_dictionary() const
Definition: var.h:140
bool is_object() const
Definition: var.h:130
bool is_double() const
Definition: var.h:165
std::string AsString() const
Special value passed to constructor to make NULL.
Definition: var.h:26
bool is_string() const
Definition: var.h:125
OutException(Var *v)
A constructor.
Definition: var.h:280
~OutException()
Destructor.
Definition: var.h:292
bool is_undefined() const
Definition: var.h:110
virtual ~Var()
Destructor.
bool is_array() const
Definition: var.h:135
Var(PassRef, const PP_Var &var)
Definition: var.h:64
const PP_Var & pp_var() const
Definition: var.h:228
bool is_resource() const
Definition: var.h:145
bool is_int() const
Definition: var.h:155
bool is_null() const
Definition: var.h:115
bool operator==(const Var &other) const
PassRef
Definition: pass_ref.h:17
Var(DontManage, const PP_Var &var)
Definition: var.h:80
virtual Var & operator=(const Var &other)
A generic type used for passing data types between the module and the page.
Definition: var.h:23
pp::Resource AsResource() const
bool is_bool() const
Definition: var.h:120
A reference counted module resource.
Definition: resource.h:20