[tracker] libtracker-data: Mark private methods explicitly as private
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-data: Mark private methods explicitly as private
- Date: Sat, 16 Sep 2017 19:52:33 +0000 (UTC)
commit d953ae3a20fb4809590c6ff1e2bcfb244119bee6
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Sep 9 20:21:32 2017 +0200
libtracker-data: Mark private methods explicitly as private
This makes it easier to spot the interactions when reading code.
src/libtracker-data/tracker-sparql-expression.vala | 76 ++++++++++----------
src/libtracker-data/tracker-sparql-pattern.vala | 44 ++++++------
src/libtracker-data/tracker-sparql-query.vala | 32 ++++----
src/libtracker-data/tracker-sparql-scanner.vala | 18 +++---
src/libtracker-data/tracker-turtle-reader.vala | 16 ++--
5 files changed, 93 insertions(+), 93 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-expression.vala
b/src/libtracker-data/tracker-sparql-expression.vala
index 338dc20..ed2a2c7 100644
--- a/src/libtracker-data/tracker-sparql-expression.vala
+++ b/src/libtracker-data/tracker-sparql-expression.vala
@@ -49,47 +49,47 @@ class Tracker.Sparql.Expression : Object {
get { return query.pattern; }
}
- inline bool next () throws Sparql.Error {
+ private inline bool next () throws Sparql.Error {
return query.next ();
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return query.current ();
}
- inline SparqlTokenType last () {
+ private inline SparqlTokenType last () {
return query.last ();
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
return query.accept (type);
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return query.get_error (msg);
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
return query.expect (type);
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
return query.get_last_string (strip);
}
- string escape_sql_string_literal (string literal) {
+ private string escape_sql_string_literal (string literal) {
return "'%s'".printf (string.joinv ("''", literal.split ("'")));
}
- bool maybe_numeric (PropertyType type) {
+ private bool maybe_numeric (PropertyType type) {
return (type == PropertyType.INTEGER || type == PropertyType.DOUBLE || type ==
PropertyType.DATE || type == PropertyType.DATETIME || type == PropertyType.UNKNOWN);
}
- void append_collate (StringBuilder sql) {
+ private void append_collate (StringBuilder sql) {
sql.append_printf (" COLLATE %s", COLLATION_NAME);
}
- void skip_bracketted_expression () throws Sparql.Error {
+ private void skip_bracketted_expression () throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
while (true) {
switch (current ()) {
@@ -234,7 +234,7 @@ class Tracker.Sparql.Expression : Object {
return type;
}
- void translate_expression_as_order_condition (StringBuilder sql) throws Sparql.Error {
+ private void translate_expression_as_order_condition (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
if (translate_expression (sql) == PropertyType.RESOURCE) {
// ID => Uri
@@ -255,7 +255,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_bound_call (StringBuilder sql) throws Sparql.Error {
+ private void translate_bound_call (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.BOUND);
expect (SparqlTokenType.OPEN_PARENS);
sql.append ("(");
@@ -264,7 +264,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- PropertyType translate_if_call (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_if_call (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.IF);
expect (SparqlTokenType.OPEN_PARENS);
@@ -289,7 +289,7 @@ class Tracker.Sparql.Expression : Object {
return type;
}
- void translate_regex (StringBuilder sql) throws Sparql.Error {
+ private void translate_regex (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.REGEX);
expect (SparqlTokenType.OPEN_PARENS);
sql.append ("SparqlRegex(");
@@ -312,7 +312,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_exists (StringBuilder sql) throws Sparql.Error {
+ private void translate_exists (StringBuilder sql) throws Sparql.Error {
sql.append ("(");
pattern.translate_exists (sql);
sql.append (")");
@@ -324,7 +324,7 @@ class Tracker.Sparql.Expression : Object {
convert_expression_to_string (sql, type, begin);
}
- static void convert_expression_to_string (StringBuilder sql, PropertyType type, long begin) {
+ private static void convert_expression_to_string (StringBuilder sql, PropertyType type, long begin) {
switch (type) {
case PropertyType.STRING:
case PropertyType.INTEGER:
@@ -360,7 +360,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_expression_as_string (StringBuilder sql) throws Sparql.Error {
+ private void translate_expression_as_string (StringBuilder sql) throws Sparql.Error {
switch (current ()) {
case SparqlTokenType.IRI_REF:
case SparqlTokenType.PN_PREFIX:
@@ -388,7 +388,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- void translate_str (StringBuilder sql) throws Sparql.Error {
+ private void translate_str (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.STR);
expect (SparqlTokenType.OPEN_PARENS);
@@ -397,7 +397,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_isuri (StringBuilder sql) throws Sparql.Error {
+ private void translate_isuri (StringBuilder sql) throws Sparql.Error {
if (!accept (SparqlTokenType.ISURI)) {
expect (SparqlTokenType.ISIRI);
}
@@ -422,7 +422,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_datatype (StringBuilder sql) throws Sparql.Error {
+ private void translate_datatype (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.DATATYPE);
expect (SparqlTokenType.OPEN_PARENS);
@@ -451,7 +451,7 @@ class Tracker.Sparql.Expression : Object {
expect (SparqlTokenType.CLOSE_PARENS);
}
- void translate_date (StringBuilder sql, string format) throws Sparql.Error {
+ private void translate_date (StringBuilder sql, string format) throws Sparql.Error {
sql.append_printf ("strftime (\"%s\", ", format);
if (accept (SparqlTokenType.VAR)) {
@@ -466,7 +466,7 @@ class Tracker.Sparql.Expression : Object {
sql.append (", \"unixepoch\")");
}
- void translate_time (StringBuilder sql, TimeFormatType type) throws Sparql.Error {
+ private void translate_time (StringBuilder sql, TimeFormatType type) throws Sparql.Error {
sql.append ("(");
if (accept (SparqlTokenType.VAR)) {
string variable_name = get_last_string ().substring (1);
@@ -490,7 +490,7 @@ class Tracker.Sparql.Expression : Object {
sql.append (")");
}
- PropertyType translate_function (StringBuilder sql, string uri) throws Sparql.Error {
+ private PropertyType translate_function (StringBuilder sql, string uri) throws Sparql.Error {
if (uri == XSD_NS + "string") {
// conversion to string
translate_expression_as_string (sql);
@@ -910,7 +910,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType parse_type_uri () throws Sparql.Error {
+ private PropertyType parse_type_uri () throws Sparql.Error {
string type_iri;
PropertyType type;
@@ -1027,7 +1027,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType translate_uri_expression (StringBuilder sql, string uri) throws Sparql.Error {
+ private PropertyType translate_uri_expression (StringBuilder sql, string uri) throws Sparql.Error {
if (accept (SparqlTokenType.OPEN_PARENS)) {
// function
var result = translate_function (sql, uri);
@@ -1043,7 +1043,7 @@ class Tracker.Sparql.Expression : Object {
}
}
- PropertyType translate_primary_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_primary_expression (StringBuilder sql) throws Sparql.Error {
PropertyType type;
switch (current ()) {
@@ -1474,7 +1474,7 @@ class Tracker.Sparql.Expression : Object {
return translate_primary_expression (sql);
}
- PropertyType translate_multiplicative_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_multiplicative_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_unary_expression (sql);
while (true) {
@@ -1505,7 +1505,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_additive_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_additive_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_multiplicative_expression (sql);
while (true) {
@@ -1536,11 +1536,11 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_numeric_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_numeric_expression (StringBuilder sql) throws Sparql.Error {
return translate_additive_expression (sql);
}
- PropertyType process_relational_expression (StringBuilder sql, long begin, uint n_bindings,
PropertyType op1type, string operator) throws Sparql.Error {
+ private PropertyType process_relational_expression (StringBuilder sql, long begin, uint n_bindings,
PropertyType op1type, string operator) throws Sparql.Error {
sql.insert (begin, "(");
sql.append (operator);
var op2type = translate_numeric_expression (sql);
@@ -1563,7 +1563,7 @@ class Tracker.Sparql.Expression : Object {
return PropertyType.BOOLEAN;
}
- PropertyType translate_in (StringBuilder sql, bool not) throws Sparql.Error {
+ private PropertyType translate_in (StringBuilder sql, bool not) throws Sparql.Error {
int in_variable_count = 0;
@@ -1594,7 +1594,7 @@ class Tracker.Sparql.Expression : Object {
return PropertyType.BOOLEAN;
}
- PropertyType translate_relational_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_relational_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
// TODO: improve performance (linked list)
uint n_bindings = query.bindings.length ();
@@ -1620,11 +1620,11 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_value_logical (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_value_logical (StringBuilder sql) throws Sparql.Error {
return translate_relational_expression (sql);
}
- PropertyType translate_conditional_and_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_conditional_and_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_value_logical (sql);
while (accept (SparqlTokenType.OP_AND)) {
@@ -1642,7 +1642,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_conditional_or_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_conditional_or_expression (StringBuilder sql) throws Sparql.Error {
long begin = sql.len;
var optype = translate_conditional_and_expression (sql);
while (accept (SparqlTokenType.OP_OR)) {
@@ -1664,7 +1664,7 @@ class Tracker.Sparql.Expression : Object {
return translate_conditional_or_expression (sql);
}
- PropertyType translate_bracketted_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_bracketted_expression (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
if (current () == SparqlTokenType.SELECT) {
@@ -1683,7 +1683,7 @@ class Tracker.Sparql.Expression : Object {
return optype;
}
- PropertyType translate_aggregate_expression (StringBuilder sql) throws Sparql.Error {
+ private PropertyType translate_aggregate_expression (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.OPEN_PARENS);
if (accept (SparqlTokenType.DISTINCT)) {
sql.append ("DISTINCT ");
diff --git a/src/libtracker-data/tracker-sparql-pattern.vala b/src/libtracker-data/tracker-sparql-pattern.vala
index 490498b..59810da 100644
--- a/src/libtracker-data/tracker-sparql-pattern.vala
+++ b/src/libtracker-data/tracker-sparql-pattern.vala
@@ -193,39 +193,39 @@ class Tracker.Sparql.Pattern : Object {
set { query.context = value; }
}
- inline bool next () throws Sparql.Error {
+ private inline bool next () throws Sparql.Error {
return query.next ();
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return query.current ();
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
return query.accept (type);
}
- inline void optional (SparqlTokenType type) throws Sparql.Error {
+ private inline void optional (SparqlTokenType type) throws Sparql.Error {
query.optional (type);
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return query.get_error (msg);
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
return query.expect (type);
}
- SourceLocation get_location () {
+ private SourceLocation get_location () {
return query.get_location ();
}
- void set_location (SourceLocation location) {
+ private void set_location (SourceLocation location) {
query.set_location (location);
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
return query.get_last_string (strip);
}
@@ -589,7 +589,7 @@ class Tracker.Sparql.Pattern : Object {
return result;
}
- void parse_object_list (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
+ private void parse_object_list (StringBuilder sql, bool in_simple_optional = false) throws
Sparql.Error {
while (true) {
parse_object (sql, in_simple_optional);
if (accept (SparqlTokenType.COMMA)) {
@@ -599,7 +599,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void parse_property_list_not_empty (StringBuilder sql, bool in_simple_optional = false) throws
Sparql.Error {
+ private void parse_property_list_not_empty (StringBuilder sql, bool in_simple_optional = false)
throws Sparql.Error {
while (true) {
var old_predicate = current_predicate;
var old_predicate_is_var = current_predicate_is_var;
@@ -643,12 +643,12 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void translate_filter (StringBuilder sql) throws Sparql.Error {
+ private void translate_filter (StringBuilder sql) throws Sparql.Error {
expect (SparqlTokenType.FILTER);
expression.translate_constraint (sql);
}
- void skip_filter () throws Sparql.Error {
+ private void skip_filter () throws Sparql.Error {
expect (SparqlTokenType.FILTER);
switch (current ()) {
@@ -685,13 +685,13 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void start_triples_block (StringBuilder sql) throws Sparql.Error {
+ private void start_triples_block (StringBuilder sql) throws Sparql.Error {
context = triple_context = new TripleContext (query, context);
sql.append ("SELECT ");
}
- void end_triples_block (StringBuilder sql, ref bool first_where, bool in_group_graph_pattern) throws
Sparql.Error {
+ private void end_triples_block (StringBuilder sql, ref bool first_where, bool in_group_graph_pattern)
throws Sparql.Error {
// remove last comma and space
sql.truncate (sql.len - 2);
@@ -808,7 +808,7 @@ class Tracker.Sparql.Pattern : Object {
context = context.parent_context;
}
- void parse_triples (StringBuilder sql, long group_graph_pattern_start, ref bool in_triples_block, ref
bool first_where, ref bool in_group_graph_pattern, bool found_simple_optional) throws Sparql.Error {
+ private void parse_triples (StringBuilder sql, long group_graph_pattern_start, ref bool
in_triples_block, ref bool first_where, ref bool in_group_graph_pattern, bool found_simple_optional) throws
Sparql.Error {
while (true) {
if (current () != SparqlTokenType.VAR &&
current () != SparqlTokenType.IRI_REF &&
@@ -844,7 +844,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- bool is_subclass (Class class1, Class class2) {
+ private bool is_subclass (Class class1, Class class2) {
if (class1 == class2) {
return true;
}
@@ -856,7 +856,7 @@ class Tracker.Sparql.Pattern : Object {
return false;
}
- bool is_simple_optional () {
+ private bool is_simple_optional () {
var optional_start = get_location ();
try {
// check that we have { ?v foo:bar ?o }
@@ -1227,7 +1227,7 @@ class Tracker.Sparql.Pattern : Object {
return result;
}
- void translate_group_or_union_graph_pattern (StringBuilder sql) throws Sparql.Error {
+ private void translate_group_or_union_graph_pattern (StringBuilder sql) throws Sparql.Error {
Variable[] all_vars = { };
HashTable<Variable,int> all_var_set = new HashTable<Variable,int>.full (Variable.hash,
Variable.equal, g_object_unref, null);
@@ -1283,7 +1283,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- VariableBindingList? get_variable_binding_list (Variable variable) {
+ private VariableBindingList? get_variable_binding_list (Variable variable) {
VariableBindingList binding_list = null;
if (triple_context != null) {
binding_list = triple_context.var_bindings.lookup (variable);
@@ -1347,7 +1347,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- void parse_object (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
+ private void parse_object (StringBuilder sql, bool in_simple_optional = false) throws Sparql.Error {
long begin_sql_len = sql.len;
bool object_is_var;
@@ -1639,7 +1639,7 @@ class Tracker.Sparql.Pattern : Object {
}
}
- DataTable get_table (string subject, string db_table, bool share_table, out bool newtable) {
+ private DataTable get_table (string subject, string db_table, bool share_table, out bool newtable) {
string tablestring = "%s.%s".printf (subject, db_table);
DataTable table = null;
newtable = false;
diff --git a/src/libtracker-data/tracker-sparql-query.vala b/src/libtracker-data/tracker-sparql-query.vala
index b25f416..f6c1249 100644
--- a/src/libtracker-data/tracker-sparql-query.vala
+++ b/src/libtracker-data/tracker-sparql-query.vala
@@ -389,7 +389,7 @@ public class Tracker.Sparql.Query : Object {
return ((string) (tokens[last_index].begin.pos + strip)).substring (0, (int)
(tokens[last_index].end.pos - tokens[last_index].begin.pos - 2 * strip));
}
- void parse_prologue () throws Sparql.Error {
+ private void parse_prologue () throws Sparql.Error {
if (accept (SparqlTokenType.BASE)) {
expect (SparqlTokenType.IRI_REF);
}
@@ -405,7 +405,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void prepare_execute () throws DBInterfaceError, Sparql.Error, DateError {
+ private void prepare_execute () throws DBInterfaceError, Sparql.Error, DateError {
assert (!update_extensions);
scanner = new SparqlScanner ((char*) query_string, (long) query_string.length);
@@ -513,7 +513,7 @@ public class Tracker.Sparql.Query : Object {
return result;
}
- DBStatement prepare_for_exec (DBInterface iface, string sql) throws DBInterfaceError, Sparql.Error,
DateError {
+ private DBStatement prepare_for_exec (DBInterface iface, string sql) throws DBInterfaceError,
Sparql.Error, DateError {
var stmt = iface.create_statement (no_cache ? DBStatementCacheType.NONE :
DBStatementCacheType.SELECT, "%s", sql);
// set literals specified in query
@@ -542,13 +542,13 @@ public class Tracker.Sparql.Query : Object {
return stmt;
}
- DBCursor? exec_sql_cursor (DBInterface iface, string sql, PropertyType[]? types, string[]?
variable_names) throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? exec_sql_cursor (DBInterface iface, string sql, PropertyType[]? types, string[]?
variable_names) throws DBInterfaceError, Sparql.Error, DateError {
var stmt = prepare_for_exec (iface, sql);
return stmt.start_sparql_cursor (types, variable_names);
}
- string get_select_query (out SelectContext context) throws DBInterfaceError, Sparql.Error, DateError {
+ private string get_select_query (out SelectContext context) throws DBInterfaceError, Sparql.Error,
DateError {
// SELECT query
// build SQL
@@ -560,7 +560,7 @@ public class Tracker.Sparql.Query : Object {
return sql.str;
}
- DBCursor? execute_select_cursor () throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? execute_select_cursor () throws DBInterfaceError, Sparql.Error, DateError {
SelectContext context;
string sql = get_select_query (out context);
var iface = manager.get_db_interface ();
@@ -568,7 +568,7 @@ public class Tracker.Sparql.Query : Object {
return exec_sql_cursor (iface, sql, context.types, context.variable_names);
}
- string get_ask_query () throws DBInterfaceError, Sparql.Error, DateError {
+ private string get_ask_query () throws DBInterfaceError, Sparql.Error, DateError {
// ASK query
var pattern_sql = new StringBuilder ();
@@ -599,7 +599,7 @@ public class Tracker.Sparql.Query : Object {
return sql.str;
}
- DBCursor? execute_ask_cursor () throws DBInterfaceError, Sparql.Error, DateError {
+ private DBCursor? execute_ask_cursor () throws DBInterfaceError, Sparql.Error, DateError {
var iface = manager.get_db_interface ();
return exec_sql_cursor (iface, get_ask_query (), new PropertyType[] { PropertyType.BOOLEAN },
new string[] { "result" });
}
@@ -617,7 +617,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void execute_insert_delete (VariantBuilder? update_blank_nodes) throws GLib.Error {
+ private void execute_insert_delete (VariantBuilder? update_blank_nodes) throws GLib.Error {
bool blank = true;
// DELETE and/or INSERT
@@ -828,7 +828,7 @@ public class Tracker.Sparql.Query : Object {
return ns + local_name;
}
- int quad_data_unbound_var_count () throws Sparql.Error {
+ private int quad_data_unbound_var_count () throws Sparql.Error {
SourceLocation current_pos = get_location ();
int n_braces = 1;
int n_unbound = 0;
@@ -853,7 +853,7 @@ public class Tracker.Sparql.Query : Object {
return n_unbound;
}
- void skip_braces () throws Sparql.Error {
+ private void skip_braces () throws Sparql.Error {
expect (SparqlTokenType.OPEN_BRACE);
int n_braces = 1;
while (n_braces > 0) {
@@ -870,7 +870,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_triples_block (Solution var_value_map, UpdateType type) throws Sparql.Error,
DateError {
+ private void parse_construct_triples_block (Solution var_value_map, UpdateType type) throws
Sparql.Error, DateError {
expect (SparqlTokenType.OPEN_BRACE);
while (current () != SparqlTokenType.CLOSE_BRACE) {
@@ -925,7 +925,7 @@ public class Tracker.Sparql.Query : Object {
bool anon_blank_node_open = false;
- string? parse_construct_var_or_term (Solution var_value_map, UpdateType type, out bool is_null)
throws Sparql.Error, DateError {
+ private string? parse_construct_var_or_term (Solution var_value_map, UpdateType type, out bool
is_null) throws Sparql.Error, DateError {
string result = "";
is_null = false;
if (current () == SparqlTokenType.VAR) {
@@ -1012,7 +1012,7 @@ public class Tracker.Sparql.Query : Object {
return result;
}
- void parse_construct_property_list_not_empty (Solution var_value_map, UpdateType type) throws
Sparql.Error, DateError {
+ private void parse_construct_property_list_not_empty (Solution var_value_map, UpdateType type) throws
Sparql.Error, DateError {
while (true) {
var old_predicate = current_predicate;
@@ -1049,7 +1049,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_object_list (Solution var_value_map, UpdateType type) throws Sparql.Error,
DateError {
+ private void parse_construct_object_list (Solution var_value_map, UpdateType type) throws
Sparql.Error, DateError {
while (true) {
parse_construct_object (var_value_map, type);
if (accept (SparqlTokenType.COMMA)) {
@@ -1059,7 +1059,7 @@ public class Tracker.Sparql.Query : Object {
}
}
- void parse_construct_object (Solution var_value_map, UpdateType type) throws Sparql.Error, DateError {
+ private void parse_construct_object (Solution var_value_map, UpdateType type) throws Sparql.Error,
DateError {
bool is_null = false;
string object = parse_construct_var_or_term (var_value_map, type, out is_null);
var data = manager.get_data ();
diff --git a/src/libtracker-data/tracker-sparql-scanner.vala b/src/libtracker-data/tracker-sparql-scanner.vala
index 79d181b..28b66a8 100644
--- a/src/libtracker-data/tracker-sparql-scanner.vala
+++ b/src/libtracker-data/tracker-sparql-scanner.vala
@@ -40,7 +40,7 @@ public class Tracker.SparqlScanner : Object {
column = location.column;
}
- SparqlTokenType get_identifier_or_keyword (char* begin, int len) {
+ private SparqlTokenType get_identifier_or_keyword (char* begin, int len) {
switch (len) {
case 1:
switch (begin[0]) {
@@ -539,7 +539,7 @@ public class Tracker.SparqlScanner : Object {
return SparqlTokenType.PN_PREFIX;
}
- SparqlTokenType read_number () {
+ private SparqlTokenType read_number () {
var type = SparqlTokenType.INTEGER;
// integer part
@@ -615,15 +615,15 @@ public class Tracker.SparqlScanner : Object {
return type;
}
- bool is_pn_char (char c) {
+ private bool is_pn_char (char c) {
return (c.isalnum () || c == '_' || c == '-');
}
- bool is_pn_local_char (char c) {
+ private bool is_pn_local_char (char c) {
return (c.isalnum () || c == '_' || c == '-' || c == '.');
}
- bool is_varname_char (char c) {
+ private bool is_varname_char (char c) {
return (c.isalnum () || c == '_');
}
@@ -959,7 +959,7 @@ public class Tracker.SparqlScanner : Object {
return type;
}
- bool matches (char* begin, string keyword) {
+ private bool matches (char* begin, string keyword) {
char* keyword_array = (char*) keyword;
for (int i = 0; keyword_array[i] != 0; i++) {
if (begin[i].toupper () != keyword_array[i]) {
@@ -969,7 +969,7 @@ public class Tracker.SparqlScanner : Object {
return true;
}
- bool whitespace () {
+ private bool whitespace () {
bool found = false;
while (current < end && current[0].isspace ()) {
if (current[0] == '\n') {
@@ -983,7 +983,7 @@ public class Tracker.SparqlScanner : Object {
return found;
}
- bool comment () {
+ private bool comment () {
if (current >= end || current[0] != '#') {
return false;
}
@@ -997,7 +997,7 @@ public class Tracker.SparqlScanner : Object {
return true;
}
- void space () {
+ private void space () {
while (whitespace () || comment ()) {
}
}
diff --git a/src/libtracker-data/tracker-turtle-reader.vala b/src/libtracker-data/tracker-turtle-reader.vala
index abc50e0..5bebdc4 100644
--- a/src/libtracker-data/tracker-turtle-reader.vala
+++ b/src/libtracker-data/tracker-turtle-reader.vala
@@ -90,7 +90,7 @@ public class Tracker.TurtleReader : Object {
prefix_map = new HashTable<string,string>.full (str_hash, str_equal, g_free, g_free);
}
- string generate_bnodeid (string? user_bnodeid) {
+ private string generate_bnodeid (string? user_bnodeid) {
// user_bnodeid is NULL for anonymous nodes
if (user_bnodeid == null) {
return ":%d".printf (++bnodeid);
@@ -109,7 +109,7 @@ public class Tracker.TurtleReader : Object {
}
}
- inline bool next_token () throws Sparql.Error {
+ private inline bool next_token () throws Sparql.Error {
index = (index + 1) % BUFFER_SIZE;
size--;
if (size <= 0) {
@@ -123,11 +123,11 @@ public class Tracker.TurtleReader : Object {
return (tokens[index].type != SparqlTokenType.EOF);
}
- inline SparqlTokenType current () {
+ private inline SparqlTokenType current () {
return tokens[index].type;
}
- inline bool accept (SparqlTokenType type) throws Sparql.Error {
+ private inline bool accept (SparqlTokenType type) throws Sparql.Error {
if (current () == type) {
next_token ();
return true;
@@ -135,11 +135,11 @@ public class Tracker.TurtleReader : Object {
return false;
}
- Sparql.Error get_error (string msg) {
+ private Sparql.Error get_error (string msg) {
return new Sparql.Error.PARSE ("%d.%d: syntax error, %s".printf (tokens[index].begin.line,
tokens[index].begin.column, msg));
}
- bool expect (SparqlTokenType type) throws Sparql.Error {
+ private bool expect (SparqlTokenType type) throws Sparql.Error {
if (accept (type)) {
return true;
}
@@ -147,12 +147,12 @@ public class Tracker.TurtleReader : Object {
throw get_error ("expected %s".printf (type.to_string ()));
}
- string get_last_string (int strip = 0) {
+ private string get_last_string (int strip = 0) {
int last_index = (index + BUFFER_SIZE - 1) % BUFFER_SIZE;
return ((string) (tokens[last_index].begin.pos + strip)).substring (0, (int)
(tokens[last_index].end.pos - tokens[last_index].begin.pos - 2 * strip));
}
- string resolve_prefixed_name (string prefix, string local_name) throws Sparql.Error {
+ private string resolve_prefixed_name (string prefix, string local_name) throws Sparql.Error {
string ns = prefix_map.lookup (prefix);
if (ns == null) {
throw get_error ("use of undefined prefix `%s'".printf (prefix));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]