本文整理匯總了C++中DirectoryEntry::getDirectory方法的典型用法代碼示例。如果您正苦於以下問題:C++ DirectoryEntry::getDirectory方法的具體用法?C++ DirectoryEntry::getDirectory怎麽用?C++ DirectoryEntry::getDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DirectoryEntry
的用法示例。
在下文中一共展示了DirectoryEntry::getDirectory方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: getDirectory
JSValue JSDirectoryEntry::getDirectory(ExecState* exec)
{
DirectoryEntry* imp = static_cast<DirectoryEntry*>(impl());
const String& path = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0));
if (exec->hadException())
return jsUndefined();
int argsCount = exec->argumentCount();
if (argsCount <= 1) {
imp->getDirectory(path);
return jsUndefined();
}
RefPtr<Flags> flags;
if (!exec->argument(1).isNull() && !exec->argument(1).isUndefined() && exec->argument(1).isObject() && !exec->argument(1).inherits(&JSFlags::s_info)) {
JSObject* object = exec->argument(1).getObject();
flags = Flags::create();
JSValue jsCreate = object->get(exec, Identifier(exec, "create"));
flags->setCreate(jsCreate.toBoolean(exec));
JSValue jsExclusive = object->get(exec, Identifier(exec, "exclusive"));
flags->setExclusive(jsExclusive.toBoolean(exec));
} else
flags = toFlags(exec->argument(1));
if (exec->hadException())
return jsUndefined();
RefPtr<EntryCallback> successCallback;
if (exec->argumentCount() > 2 && !exec->argument(2).isNull() && !exec->argument(2).isUndefined()) {
if (!exec->argument(2).isObject()) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
successCallback = JSEntryCallback::create(asObject(exec->argument(2)), globalObject());
}
RefPtr<ErrorCallback> errorCallback;
if (exec->argumentCount() > 3 && !exec->argument(3).isNull() && !exec->argument(3).isUndefined()) {
if (!exec->argument(3).isObject()) {
setDOMException(exec, TYPE_MISMATCH_ERR);
return jsUndefined();
}
errorCallback = JSErrorCallback::create(asObject(exec->argument(3)), globalObject());
}
imp->getDirectory(path, flags, successCallback, errorCallback);
return jsUndefined();
}