Beispiel #1
0
void FromJSObject(std::vector<std::map<gcString, gcString>> &args, JSObjHandle& arg)
{
    if (arg->isArray() == false)
        return;

    for (int x=0; x<arg->getArrayLength(); x++)
    {
        JSObjHandle a = arg->getValue(x);

        std::map<gcString, gcString> m;
        FromJSObject(m, a);

        args.push_back(m);
    }
}
Beispiel #2
0
void FromJSObject(std::map<gcString, gcString> &map, JSObjHandle& arg)
{
    if (arg->isArray() == false && arg->isObject() == false)
        return;

    for (int y=0; y<arg->getNumberOfKeys(); y++)
    {
        char key[255] = {0};
        gcString val;

        arg->getKey(y, key, 255);

        try
        {
            JSObjHandle jObj = arg->getValue(key);
            FromJSObject(val, jObj);
            map[gcString(key)] = val;
        }
        catch (...) // TODO
        {
        }
    }
}