def get_key(self): ''' Get the current key at the iterator :returns: The current key at the iterator ''' size = new_native_size() pointer = LDB.leveldb_iter_key(self.iterator, get_reference_to(size)) return as_python_string(pointer, size)
def get_value(self): ''' Get the current value at the iterator :returns: The current value at the iterator ''' size = new_native_size() pointer = LDB.leveldb_iter_value(self.iterator, ctypes.byref(length)) return as_python_string(pointer, size)
def get(self, key, verify_checksum=False, fill_cache=True): ''' Delete the supplied value at the given key. :param key: The key to delete the value at :throws DatabaseException: If an error has occurred ''' result = None options = self.get_read_options(verify_checksum, fill_cache) try: error = new_native_string() size = new_native_size() value = LDB.leveldb_get(self.database, options, key, len(key), get_reference_to(size), get_reference_to(error)) self.handle_error(error) return as_python_string(value, size) finally: if LDB and options: LDB.leveldb_readoptions_destroy(options)