deleteFromCache method

void deleteFromCache(
  1. String key
)

Deletes the cache item identified by key.

Return valueMeaning

| true | | The item was deleted, or no item existed for the key. |

| false | | The item exists but could not be deleted, for example because of a filesystem permission or sharing error. |

Idempotent deletion: A missing key is not treated as an error, which makes it safe to call this method when the application merely wants to ensure that an item is absent.

Throws a ChilkatException if the call fails; the details are in ChilkatException.lastErrorText. Throws an ArgumentError if a string argument contains a NUL character.

Implementation

void deleteFromCache(String key) {
  final h = _handle;
  using((arena) {
    final r = _CkCache_DeleteFromCache(h, _toNative(arena, key, 'key'));
    if (r == 0) {
      throw _fail('deleteFromCache');
    }
  });
}