OLD | NEW |
(Empty) | |
| 1 |
| 2 class _IDBObjectStoreImpl extends _DOMTypeBase implements IDBObjectStore { |
| 3 _IDBObjectStoreImpl._wrap(ptr) : super._wrap(ptr); |
| 4 |
| 5 List<String> get indexNames() => _wrap(_ptr.indexNames); |
| 6 |
| 7 String get keyPath() => _wrap(_ptr.keyPath); |
| 8 |
| 9 String get name() => _wrap(_ptr.name); |
| 10 |
| 11 IDBTransaction get transaction() => _wrap(_ptr.transaction); |
| 12 |
| 13 IDBRequest add(Dynamic value, [IDBKey key = null]) { |
| 14 if (key === null) { |
| 15 return _wrap(_ptr.add(_unwrap(value))); |
| 16 } else { |
| 17 return _wrap(_ptr.add(_unwrap(value), _unwrap(key))); |
| 18 } |
| 19 } |
| 20 |
| 21 IDBRequest clear() { |
| 22 return _wrap(_ptr.clear()); |
| 23 } |
| 24 |
| 25 IDBRequest count([IDBKeyRange range = null]) { |
| 26 if (range === null) { |
| 27 return _wrap(_ptr.count()); |
| 28 } else { |
| 29 return _wrap(_ptr.count(_unwrap(range))); |
| 30 } |
| 31 } |
| 32 |
| 33 IDBIndex createIndex(String name, String keyPath) { |
| 34 return _wrap(_ptr.createIndex(_unwrap(name), _unwrap(keyPath))); |
| 35 } |
| 36 |
| 37 IDBRequest delete(IDBKey key) { |
| 38 return _wrap(_ptr.delete(_unwrap(key))); |
| 39 } |
| 40 |
| 41 void deleteIndex(String name) { |
| 42 _ptr.deleteIndex(_unwrap(name)); |
| 43 return; |
| 44 } |
| 45 |
| 46 IDBRequest getObject(IDBKey key) { |
| 47 return _wrap(_ptr.getObject(_unwrap(key))); |
| 48 } |
| 49 |
| 50 IDBIndex index(String name) { |
| 51 return _wrap(_ptr.index(_unwrap(name))); |
| 52 } |
| 53 |
| 54 IDBRequest openCursor([IDBKeyRange range = null, int direction = null]) { |
| 55 if (range === null) { |
| 56 if (direction === null) { |
| 57 return _wrap(_ptr.openCursor()); |
| 58 } |
| 59 } else { |
| 60 if (direction === null) { |
| 61 return _wrap(_ptr.openCursor(_unwrap(range))); |
| 62 } else { |
| 63 return _wrap(_ptr.openCursor(_unwrap(range), _unwrap(direction))); |
| 64 } |
| 65 } |
| 66 throw "Incorrect number or type of arguments"; |
| 67 } |
| 68 |
| 69 IDBRequest put(Dynamic value, [IDBKey key = null]) { |
| 70 if (key === null) { |
| 71 return _wrap(_ptr.put(_unwrap(value))); |
| 72 } else { |
| 73 return _wrap(_ptr.put(_unwrap(value), _unwrap(key))); |
| 74 } |
| 75 } |
| 76 } |
OLD | NEW |