当前位置: 首页>>代码示例>>C++>>正文


C++ MediaList::deleteMedium方法代码示例

本文整理汇总了C++中MediaList::deleteMedium方法的典型用法代码示例。如果您正苦于以下问题:C++ MediaList::deleteMedium方法的具体用法?C++ MediaList::deleteMedium怎么用?C++ MediaList::deleteMedium使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MediaList的用法示例。


在下文中一共展示了MediaList::deleteMedium方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: jsMediaListPrototypeFunctionDeleteMedium

JSValue* jsMediaListPrototypeFunctionDeleteMedium(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSMediaList::s_info))
        return throwError(exec, TypeError);
    JSMediaList* castedThisObj = static_cast<JSMediaList*>(thisValue);
    MediaList* imp = static_cast<MediaList*>(castedThisObj->impl());
    ExceptionCode ec = 0;
    const UString& oldMedium = args.at(exec, 0)->toString(exec);

    imp->deleteMedium(oldMedium, ec);
    setDOMException(exec, ec);
    return jsUndefined();
}
开发者ID:achellies,项目名称:ISeeBrowser,代码行数:13,代码来源:JSMediaList.cpp

示例2: deleteMediumCallback

static v8::Handle<v8::Value> deleteMediumCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.MediaList.deleteMedium");
    MediaList* imp = V8MediaList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, oldMedium, args[0]);
    imp->deleteMedium(oldMedium, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8::Handle<v8::Value>();
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
开发者ID:Treeeater,项目名称:chrome_bindings,代码行数:16,代码来源:V8MediaList.cpp

示例3: jsMediaListPrototypeFunctionDeleteMedium

EncodedJSValue JSC_HOST_CALL jsMediaListPrototypeFunctionDeleteMedium(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSMediaList::s_info))
        return throwVMTypeError(exec);
    JSMediaList* castedThis = static_cast<JSMediaList*>(asObject(thisValue));
    MediaList* imp = static_cast<MediaList*>(castedThis->impl());
    ExceptionCode ec = 0;
    const String& oldMedium(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->deleteMedium(oldMedium, ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}
开发者ID:13W,项目名称:phantomjs,代码行数:16,代码来源:JSMediaList.cpp

示例4: callAsFunction

JSValue* JSMediaListPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
    if (!thisObj->inherits(&JSMediaList::info))
      return throwError(exec, TypeError);

    JSMediaList* castedThisObj = static_cast<JSMediaList*>(thisObj);
    MediaList* imp = static_cast<MediaList*>(castedThisObj->impl());

    switch (id) {
    case JSMediaList::ItemFuncNum: {
        bool indexOk;
        unsigned index = args[0]->toInt32(exec, indexOk);
        if (!indexOk) {
            setDOMException(exec, TYPE_MISMATCH_ERR);
            return jsUndefined();
        }


        KJS::JSValue* result = jsStringOrNull(imp->item(index));
        return result;
    }
    case JSMediaList::DeleteMediumFuncNum: {
        ExceptionCode ec = 0;
        String oldMedium = args[0]->toString(exec);

        imp->deleteMedium(oldMedium, ec);
        setDOMException(exec, ec);
        return jsUndefined();
    }
    case JSMediaList::AppendMediumFuncNum: {
        ExceptionCode ec = 0;
        String newMedium = args[0]->toString(exec);

        imp->appendMedium(newMedium, ec);
        setDOMException(exec, ec);
        return jsUndefined();
    }
    }
    return 0;
}
开发者ID:Crawping,项目名称:davinci,代码行数:40,代码来源:JSMediaList.cpp


注:本文中的MediaList::deleteMedium方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。