ExceptionOr<Ref<IDBRequest>> IDBIndex::count(ExecState& execState, JSValue key) { LOG(IndexedDB, "IDBIndex::count"); auto idbKey = scriptValueToIDBKey(execState, key); if (!idbKey->isValid()) return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key.") }; return doCount(execState, IDBKeyRangeData(idbKey.ptr())); }
RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, IDBKeyRange* range, ExceptionCode& ec) { LOG(IndexedDB, "IDBObjectStore::count"); if (!context) { ec = INVALID_STATE_ERR; return nullptr; } return doCount(*context, IDBKeyRangeData(range), ec); }
RefPtr<WebCore::IDBRequest> IDBIndex::count(ScriptExecutionContext* context, IDBKeyRange* range, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBIndex::count"); if (!context) { ec.code = IDBDatabaseException::InvalidStateError; return nullptr; } return doCount(*context, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec); }
RefPtr<WebCore::IDBRequest> IDBIndex::count(ScriptExecutionContext* context, ExceptionCode& ec) { LOG(IndexedDB, "IDBIndex::count"); if (!context) { ec = INVALID_STATE_ERR; return nullptr; } IDBKeyRangeData range; range.isNull = false; return doCount(*context, range, ec);}
void tieuhoc5() { int k = 1; int count = 0; for (int i = 0; i < 5; i++) { count = doCount(i); if (count == k - 1) { printf("%d", s[i]); } } }
RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBObjectStore::count"); if (!context) { ec.code = IDBDatabaseException::InvalidStateError; return nullptr; } IDBKeyRangeData range; range.isNull = false; return doCount(*context, range, ec); }
RefPtr<IDBRequest> IDBObjectStore::count(ExecState& execState, JSValue key, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBObjectStore::count"); Ref<IDBKey> idbKey = scriptValueToIDBKey(execState, key); if (!idbKey->isValid()) { ec.code = IDBDatabaseException::DataError; ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key."); return nullptr; } return doCount(execState, IDBKeyRangeData(idbKey.ptr()), ec); }
RefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext& context, const Deprecated::ScriptValue& key, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBIndex::count"); DOMRequestState requestState(&context); RefPtr<IDBKey> idbKey = scriptValueToIDBKey(&requestState, key); if (!idbKey || idbKey->type() == KeyType::Invalid) { ec.code = IDBDatabaseException::DataError; ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBIndex': The parameter is not a valid key."); return nullptr; } return doCount(context, IDBKeyRangeData(idbKey.get()), ec); }
RefPtr<WebCore::IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, const Deprecated::ScriptValue& key, ExceptionCode& ec) { LOG(IndexedDB, "IDBObjectStore::count"); if (!context) { ec = INVALID_STATE_ERR; return nullptr; } DOMRequestState requestState(context); RefPtr<IDBKey> idbKey = scriptValueToIDBKey(&requestState, key); if (!idbKey || idbKey->type() == KeyType::Invalid) { ec = static_cast<ExceptionCode>(IDBExceptionCode::DataError); return nullptr; } return doCount(*context, IDBKeyRangeData(idbKey.get()), ec); }
RefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext& context, JSValue key, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBObjectStore::count"); auto exec = context.execState(); if (!exec) { ec.code = IDBDatabaseException::UnknownError; ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBObjectStore': Script execution context does not have an execution state."); return nullptr; } Ref<IDBKey> idbKey = scriptValueToIDBKey(*exec, key); if (!idbKey->isValid()) { ec.code = IDBDatabaseException::DataError; ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBObjectStore': The parameter is not a valid key."); return nullptr; } return doCount(context, IDBKeyRangeData(idbKey.ptr()), ec); }
ExceptionOr<Ref<IDBRequest>> IDBIndex::count(ExecState& execState, IDBKeyRange* range) { LOG(IndexedDB, "IDBIndex::count"); return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys()); }
/*this is the main routine*/ void doshell() { char line[80]; /*run forever - the shell shouldn't end*/ while(1==1) { /*read in a line*/ printstring("SHELL>\0"); readstring(line); /*match it against each possible command*/ /*if the user presses return, ignore it*/ if (line[0]==0xd) continue; else if (iscommand(line,"CLS\0")==1) doclear(); else if (iscommand(line,"cls\0")==1) doclear(); else if (iscommand(line,"COPY\0")==1) docopy(); else if (iscommand(line,"copy\0")==1) docopy(); else if (iscommand(line,"CREATE \0")==1) docreate(line); else if (iscommand(line,"create \0")==1) docreate(line); else if (iscommand(line,"DELETE \0")==1) dodelete(line); else if (iscommand(line,"delete \0")==1) dodelete(line); else if (iscommand(line,"DIR\0")==1) dodir(); else if (iscommand(line,"dir\0")==1) dodir(); else if (iscommand(line,"EXEC \0")==1) doexecute(line,1); else if (iscommand(line,"exec \0")==1) doexecute(line,1); else if (iscommand(line,"EXECBACK \0")==1) doexecute(line,0); else if (iscommand(line,"execback \0")==1) doexecute(line,0); else if (iscommand(line,"HELP\0")==1) dohelp(); else if (iscommand(line,"help\0")==1) dohelp(); else if (line[0]=='?') dohelp(); else if (iscommand(line,"TYPE \0")==1) dotype(line); else if (iscommand(line,"type \0")==1) dotype(line); else if (iscommand(line,"KILL \0")==1) dokill(line); else if (iscommand(line,"kill \0")==1) dokill(line); else if (iscommand(line,"mkdir \0")==1) domkdir(line); else if (iscommand(line,"MKDIR\0")==1) domkdir(line); else if (iscommand(line,"FORMAT\0")==1) doFormat(); else if (iscommand(line,"format\0")==1) doFormat(); else if (iscommand(line,"remove\0")==1) doRemove(line); else if (iscommand(line,"REMOVE\0")==1) doRemove(line); else if (iscommand(line,"list\0")==1) doList(); else if (iscommand(line,"LIST\0")==1) doList(); else if (iscommand(line,"count\0")==1) doCount(line); else if (iscommand(line,"WRITE\0")==1) doCreateFile(line); else if (iscommand(line,"write\0")==1) doCreateFile(line); else if (iscommand(line,"READ\0")==1) doEcho(line); else if (iscommand(line,"read\0")==1) doEcho(line); else printstring("Command not found\r\n\0"); printstring("\r\n\0"); } }
RefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext& context, IDBKeyRange* range, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBIndex::count"); return doCount(context, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec); }
RefPtr<IDBRequest> IDBObjectStore::count(ExecState& execState, IDBKeyRange* range, ExceptionCodeWithMessage& ec) { LOG(IndexedDB, "IDBObjectStore::count"); return doCount(execState, range ? IDBKeyRangeData(range) : IDBKeyRangeData::allKeys(), ec); }