Utilities

## Utilities Utilities — Utility and miscellaneous functions. |

## Synopsis

    #include <libtracker-client/tracker-client.h>

    gchar *             tracker_sparql_escape               (const gchar *str);
    gchar *             tracker_uri_printf_escaped          (const gchar *format,
                                                             ...);
    gchar *             tracker_uri_vprintf_escaped         (const gchar *format,
                                                             va_list args);

## Description

This is miscellaneous API that may be useful to users.

## Details

### tracker_sparql_escape ()

    gchar *             tracker_sparql_escape               (const gchar *str);

### Warning

`tracker_sparql_escape` has been deprecated since version 0.10 and should not be used in newly-written code. For `tracker_sparql_escape_string()` in libtracker-sparql

Escapes a string so it can be passed as a SPARQL parameter in any query/update.

`str` : | a string to escape.
Returns : | the newly allocated escaped string which must be freed using `g_free()`.

Since 0.8

### tracker_uri_printf_escaped ()

    gchar *             tracker_uri_printf_escaped          (const gchar *format,
                                                             ...);

### Warning

`tracker_uri_printf_escaped` has been deprecated since version 0.10 and should not be used in newly-written code. For `tracker_sparql_escape_uri_printf()` in libtracker-sparql

Calls `tracker_uri_vprintf_escaped()` with the `Varargs` supplied.

`format` : | a standard `printf()` format string, but notice string precision pitfalls
`...` : | the parameters to insert into the format string
Returns : | a newly-allocated string holding the result which should be freed with `g_free()` when finished with.

Since 0.8

### tracker_uri_vprintf_escaped ()

    gchar *             tracker_uri_vprintf_escaped         (const gchar *format,
                                                             va_list args);

### Warning

`tracker_uri_vprintf_escaped` has been deprecated since version 0.10 and should not be used in newly-written code. For `tracker_sparql_escape_uri_vprintf()` in libtracker-sparql

Similar to the standard C `vsprintf()` function but safer, since it calculates the maximum space required and allocates memory to hold the result.

The result is escaped using `g_uri_escape_string()`.

`format` : | a standard `printf()` format string, but notice string precision pitfalls
`args` : | the list of parameters to insert into the format string
Returns : | a newly-allocated string holding the result which should be freed with `g_free()` when finished with.

Since 0.8