void FromJSObject<gcRefPtr<UserCore::Item::BranchInfoI>>(gcRefPtr<UserCore::Item::BranchInfoI> &branch, JSObjHandle& arg) { if (arg->isObject()) branch = arg->getUserObject<UserCore::Item::BranchInfoI>(); else branch = nullptr; }
void FromJSObject<gcRefPtr<UserCore::Misc::UploadInfoThreadI>>(gcRefPtr<UserCore::Misc::UploadInfoThreadI> &upload, JSObjHandle& arg) { if (arg->isObject()) upload = arg->getUserObject<UserCore::Misc::UploadInfoThreadI>(); else upload = nullptr; }
void FromJSObject(ServiceItem* &jsItem, JSObjHandle& arg) { if (arg->isObject()) jsItem = dynamic_cast<ServiceItem*>(arg->getUserObject<ScriptCoreItemI>()); else jsItem = NULL; }
void FromJSObject(UserItem* &jsItem, JSObjHandle& arg) { if (arg->isObject()) jsItem = dynamic_cast<UserItem*>(arg->getUserObject<ScriptCoreItemI>()); else jsItem = nullptr; }
void FromJSObject(UserCore::Misc::UploadInfoThreadI* &upload, JSObjHandle& arg) { if (arg->isObject()) upload = arg->getUserObject<UserCore::Misc::UploadInfoThreadI>(); else upload = NULL; }
void FromJSObject<UTIL::FS::FileHandle*>(UTIL::FS::FileHandle* &jsItem, JSObjHandle& arg) { if (arg->isObject()) jsItem = arg->getUserObject<UTIL::FS::FileHandle>(); else jsItem = nullptr; }
void FromJSObject<gcRefPtr<UserCore::Item::ItemInfoI>>(gcRefPtr<UserCore::Item::ItemInfoI> &item, JSObjHandle& arg) { if (arg->isObject() == false) return; item = arg->getUserObject<UserCore::Item::ItemInfoI>(); }
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 { } } }