[tracker/wip/carlosg/fix-tracker-search: 1/4] libtracker-data: Add builtin way to convert a Expression to a string
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/fix-tracker-search: 1/4] libtracker-data: Add builtin way to convert a Expression to a string
- Date: Sat, 17 Nov 2018 14:59:21 +0000 (UTC)
commit 3ce5b32c8b46c02fede964ea492a217e45d0727f
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Nov 17 15:32:37 2018 +0100
libtracker-data: Add builtin way to convert a Expression to a string
The Expression element may be used in several places (eg. ArgList or
ExpressionList in functions) that may require them to be converted
to string, add a builtin toggle in the state so this can ben done
easily.
src/libtracker-data/tracker-sparql.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index a45eb4a17..b7d519dac 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -142,6 +142,8 @@ struct _TrackerSparql
const gchar *expression_list_separator;
TrackerPropertyType expression_type;
guint type;
+
+ gboolean convert_to_string;
} current_state;
};
@@ -4609,10 +4611,28 @@ static gboolean
translate_Expression (TrackerSparql *sparql,
GError **error)
{
+ TrackerStringBuilder *str, *old;
+ gboolean convert_to_string;
+
/* Expression ::= ConditionalOrExpression
*/
+ convert_to_string = sparql->current_state.convert_to_string;
+ sparql->current_state.convert_to_string = FALSE;
+
+ if (convert_to_string) {
+ str = _append_placeholder (sparql);
+ old = tracker_sparql_swap_builder (sparql, str);
+ }
+
_call_rule (sparql, NAMED_RULE_ConditionalOrExpression, error);
+ if (convert_to_string) {
+ convert_expression_to_string (sparql, sparql->current_state.expression_type);
+ tracker_sparql_swap_builder (sparql, old);
+ }
+
+ sparql->current_state.convert_to_string = convert_to_string;
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]