Camel.DataCache.add

### Method

# Camel DataCacheadd

#### Declaration [src]

    GIOStream*
    camel_data_cache_add (
      CamelDataCache* cdc,
      const gchar* path,
      const gchar* key,
      GError** error
    )

#### Description [src]

Add a new item to the cache, returning a `GIOStream` to the new item.

The key and the path combine to form a unique key used to store the item.

Potentially, expiry processing will be performed while this call is executing.

The returned `GIOStream` is referenced for thread-safety and must be unreferenced with `g_object_unref()` when finished with it.

#### Parameters

`path`

  Type: `const gchar*`

  Relative path of item to add.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`key`

  Type: `const gchar*`

  Key of item to add.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `GIOStream`

A `GIOStream` for the new cache item, or `NULL` on error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.