本文整理汇总了C++中SVGLengthList::replaceItem方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGLengthList::replaceItem方法的具体用法?C++ SVGLengthList::replaceItem怎么用?C++ SVGLengthList::replaceItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGLengthList
的用法示例。
在下文中一共展示了SVGLengthList::replaceItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsSVGLengthListPrototypeFunctionReplaceItem
JSValue JSC_HOST_CALL jsSVGLengthListPrototypeFunctionReplaceItem(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSSVGLengthList::s_info))
return throwError(exec, TypeError);
JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(asObject(thisValue));
SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
ExceptionCode ec = 0;
SVGLength item = toSVGLength(args.at(0));
unsigned index = args.at(1).toInt32(exec);
JSC::JSValue result = toJS(exec, deprecatedGlobalObjectForPrototype(exec), JSSVGStaticPODTypeWrapper<SVGLength>::create(imp->replaceItem(item, index, ec)).get(), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
示例2: callAsFunction
JSValue* JSSVGLengthListPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
if (!thisObj->inherits(&JSSVGLengthList::info))
return throwError(exec, TypeError);
JSSVGLengthList* castedThisObj = static_cast<JSSVGLengthList*>(thisObj);
SVGLengthList* imp = static_cast<SVGLengthList*>(castedThisObj->impl());
switch (id) {
case JSSVGLengthList::ClearFuncNum: {
ExceptionCode ec = 0;
imp->clear(ec);
setDOMException(exec, ec);
return jsUndefined();
}
case JSSVGLengthList::InitializeFuncNum: {
ExceptionCode ec = 0;
SVGLength item = toSVGLength(args[0]);
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->initialize(item, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
case JSSVGLengthList::GetItemFuncNum: {
ExceptionCode ec = 0;
bool indexOk;
unsigned index = args[0]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->getItem(index, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
case JSSVGLengthList::InsertItemBeforeFuncNum: {
ExceptionCode ec = 0;
SVGLength item = toSVGLength(args[0]);
bool indexOk;
unsigned index = args[1]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->insertItemBefore(item, index, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
case JSSVGLengthList::ReplaceItemFuncNum: {
ExceptionCode ec = 0;
SVGLength item = toSVGLength(args[0]);
bool indexOk;
unsigned index = args[1]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->replaceItem(item, index, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
case JSSVGLengthList::RemoveItemFuncNum: {
ExceptionCode ec = 0;
bool indexOk;
unsigned index = args[0]->toInt32(exec, indexOk);
if (!indexOk) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->removeItem(index, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
case JSSVGLengthList::AppendItemFuncNum: {
ExceptionCode ec = 0;
SVGLength item = toSVGLength(args[0]);
KJS::JSValue* result = toJS(exec, new JSSVGPODTypeWrapperCreatorReadOnly<SVGLength>(imp->appendItem(item, ec)), castedThisObj->context());
setDOMException(exec, ec);
return result;
}
}
return 0;
}