Thanks! That seems to work. However, I'm still having trouble
converting some types of the properties on the object to something
useable in my C++.

For instance:

v8::String::Utf8Value my_str = v8::String::Utf8Value(obj-
>Get(v8::String::New("my_str")));

That works for getting a string property (`my_str`) value out. But now
that I have a v8::String::Utf8Value, is there a straightforward way to
get that value into something I can use, like a C++ std::string for
instance?

This is what I came up with from the sample code:

const char* ToCString(const v8::String::Utf8Value& value) {
        return *value ? *value : "<string conversion failed>";
}

...

std::string my_str =
std::string::New(ToCString(v8::String::Utf8Value(obj-
>Get(v8::String::New("my_str")))));

That seems kinda convoluted, but works. However, is there another more
direct way?

And what about extracting a Boolean? Integer? Float? Array? Haven't
found any documentation about how to get at those other property
types. Any help is greatly appreciated.

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to