diff options
Diffstat (limited to 'libsecret/secret-value.c')
-rw-r--r-- | libsecret/secret-value.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libsecret/secret-value.c b/libsecret/secret-value.c index cbfdf6b..64130e0 100644 --- a/libsecret/secret-value.c +++ b/libsecret/secret-value.c @@ -44,6 +44,8 @@ * Stability: Unstable */ +static gboolean is_password_value (SecretValue *value); + /** * SecretValue: * @@ -170,6 +172,26 @@ secret_value_get (SecretValue *value, } /** + * secret_value_get_text: + * @value: the value + * + * Get the secret data in the #SecretValue if it contains a textual + * value. The content type must be <literal>text/plain</literal>. + * + * Returns: (allow-none): the content type + */ +const gchar * +secret_value_get_text (SecretValue *value) +{ + g_return_val_if_fail (value, NULL); + + if (!is_password_value (value)) + return NULL; + + return value->secret; +} + +/** * secret_value_get_content_type: * @value: the value * |