Top |
Functions
Types and Values
#define | IANJUTA_SYMBOL_QUERY_ERROR |
enum | IAnjutaSymbolQueryDb |
enum | IAnjutaSymbolQueryFileScope |
enum | IAnjutaSymbolQueryMode |
enum | IAnjutaSymbolQueryName |
Object Hierarchy
GEnum ├── IAnjutaSymbolQueryDb ├── IAnjutaSymbolQueryFileScope ├── IAnjutaSymbolQueryMode ╰── IAnjutaSymbolQueryName GInterface ╰── IAnjutaSymbolQuery
Description
A query object will have this interface that allows to tweak various query parameters. Except for the IAnjutaSymbolQueryName and IAnjutaSymbolQueryDb parameters, everything else is changable post-creation.
Note that chaning a query parameter, except for limit and offset will result in re-preparing the query the next time it is executed, so it is not advisable to change it each time the query is executed. For such cases, create different queries with different parameters.
A query is signified by a name enumeration (IAnjutaSymbolQueryName) which practically determines the query type and its execution condition. Each query name is assigned to pre-defined query statement and can only be set during creation time. Then only its specific ianjuta_symbol_query_search_*() can be used to execute the query. These specific execution methods are provided to make it convenient to pass query parameters easily and to ensure all the needed parameters are given.
A query can run in different modes, defined by IAnjutaSymbolQueryMode, by
default it is executed in synchrounous mode IANJUTA_SYMBOL_QUERY_MODE_SYNC
and can be changed using ianjuta_symbol_query_set_mode()
.
IANJUTA_SYMBOL_QUERY_MODE_ASYNC runs it in asynchronous mode in a separate
thread and can be canceled with ianjuta_symbol_query_cancel()
.
A query runs on a database, defined by IAnjutaSymbolQueryDb, and can be only selected at creatation time.
In addition, there are many other filters that can be set to the query
to refine the query results. For example, ianjuta_symbol_query_set_fields()
is used to set the needed symbol fields to retrieve, ianjuta_symbol_query_set_filters()
is used to filter the results with symbol types, ianjuta_symbol_query_set_file_scope()
limits the results to either public or private scope within the source file,
ianjuta_symbol_query_set_group_by()
is used to group the results on a given
field, ianjuta_symbol_query_set_order_by is used to order the results on a
given field.
ianjuta_symbol_query_set_limit() and ianjuta_symbol_query_set_offset()
are
used to change limit and offset of the resultset. Note again that these
parameters do not require re-preparation of query, so can be safely used
any time without performance hit.
Functions
ianjuta_symbol_query_cancel ()
void ianjuta_symbol_query_cancel (IAnjutaSymbolQuery *obj
,GError **err
);
ianjuta_symbol_query_search ()
IAnjutaIterable * ianjuta_symbol_query_search (IAnjutaSymbolQuery *obj
,const gchar *pattern
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH query.
ianjuta_symbol_query_search_all ()
IAnjutaIterable * ianjuta_symbol_query_search_all (IAnjutaSymbolQuery *obj
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_ALL query.
ianjuta_symbol_query_search_class_parents ()
IAnjutaIterable * ianjuta_symbol_query_search_class_parents (IAnjutaSymbolQuery *obj
,IAnjutaSymbol *symbol
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_CLASS_PARENTS query.
ianjuta_symbol_query_search_file ()
IAnjutaIterable * ianjuta_symbol_query_search_file (IAnjutaSymbolQuery *obj
,const gchar *pattern
,const GFile *file
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_FILE query.
ianjuta_symbol_query_search_id ()
IAnjutaIterable * ianjuta_symbol_query_search_id (IAnjutaSymbolQuery *obj
,gint symbol
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_ID query.
ianjuta_symbol_query_search_in_scope ()
IAnjutaIterable * ianjuta_symbol_query_search_in_scope (IAnjutaSymbolQuery *obj
,const gchar *pattern
,IAnjutaSymbol *scope
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_IN_SCOPE query.
ianjuta_symbol_query_search_members ()
IAnjutaIterable * ianjuta_symbol_query_search_members (IAnjutaSymbolQuery *obj
,IAnjutaSymbol *symbol
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_MEMBERS query.
ianjuta_symbol_query_search_parent_scope ()
IAnjutaIterable * ianjuta_symbol_query_search_parent_scope (IAnjutaSymbolQuery *obj
,IAnjutaSymbol *symbol
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_PARENT_SCOPE query.
ianjuta_symbol_query_search_parent_scope_file ()
IAnjutaIterable * ianjuta_symbol_query_search_parent_scope_file (IAnjutaSymbolQuery *obj
,IAnjutaSymbol *symbol
,const gchar *file_path
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_PARENT_SCOPE_FILE query.
ianjuta_symbol_query_search_scope ()
IAnjutaIterable * ianjuta_symbol_query_search_scope (IAnjutaSymbolQuery *obj
,const gchar *file_path
,gint line
,GError **err
);
Executes IANJUTA_SYMBOL_QUERY_SEARCH_SCOPE query.
ianjuta_symbol_query_set_fields ()
void ianjuta_symbol_query_set_fields (IAnjutaSymbolQuery *obj
,gint n_fields
,IAnjutaSymbolField *fields
,GError **err
);
Sets the fields of Query.
ianjuta_symbol_query_set_file_scope ()
void ianjuta_symbol_query_set_file_scope (IAnjutaSymbolQuery *obj
,IAnjutaSymbolQueryFileScope filescope_search
,GError **err
);
Sets the filescope search of Query.
ianjuta_symbol_query_set_filters ()
void ianjuta_symbol_query_set_filters (IAnjutaSymbolQuery *obj
,IAnjutaSymbolType filters
,gboolean include_types
,GError **err
);
Sets the bit mask of symbol type filters. if include_types
is TRUE,
symbols satisfying the given symbol types are selected, otherwise
they are excluded.
ianjuta_symbol_query_set_group_by ()
void ianjuta_symbol_query_set_group_by (IAnjutaSymbolQuery *obj
,IAnjutaSymbolField field
,GError **err
);
Sets the field with which result of query is grouped. As a result there will be no duplicates of with this field.
ianjuta_symbol_query_set_limit ()
void ianjuta_symbol_query_set_limit (IAnjutaSymbolQuery *obj
,gint limit
,GError **err
);
Sets the limit of Query results. No more than limit
results are
returned.
ianjuta_symbol_query_set_mode ()
void ianjuta_symbol_query_set_mode (IAnjutaSymbolQuery *obj
,IAnjutaSymbolQueryMode mode
,GError **err
);
Sets the mode of Query.
ianjuta_symbol_query_set_offset ()
void ianjuta_symbol_query_set_offset (IAnjutaSymbolQuery *obj
,gint offset
,GError **err
);
Sets the offset index of Query results.
ianjuta_symbol_query_set_order_by ()
void ianjuta_symbol_query_set_order_by (IAnjutaSymbolQuery *obj
,IAnjutaSymbolField field
,GError **err
);
Sets the field with which result of query is ordered.
Types and Values
enum IAnjutaSymbolQueryDb
Sets the database to use for the query. System database is where all system library symbols are found. While project database is where currently open project's symbols are found.
enum IAnjutaSymbolQueryMode
This parameter determines the mode of query execution. By default, IANJUTA_SYMBOL_QUERY_MODE_SYNC is selected.
Members
Syncronous query. The result is immediately available as retrun value of search call. |
||
Asynchronous query. The search call return immediately and result delievered as a signal later. The actual query is done in a separate thread. |
||
If the database is busy scanning, then the query is performed later when database is ready. It returns NULL and result is delivered through async-result signal. Only query can stay queued, so calling search multiple times would result in only the last one being active. |
enum IAnjutaSymbolQueryName
Names of query that defined what kind of query it is.
Members
Query to perform basic substring search. |
||
Query to get all symbols |
||
Query to perform substring search in a file. |
||
Query to perform substring search in a scope. |
||
Query to find the symbol of given ID. |
||
Query to find members of a scope (eg. class). |
||
Query to get parents of a class. |
||
Query to find scope name of a file position. |
||
Query to get the parent scope of a symbol. |
||
Query to get the parent scope of a symbol in the file. |
Signal Details
The “async-result”
signal
void user_function (IAnjutaSymbolQuery *ianjutasymbolquery, GObject *arg1, gpointer user_data)
Flags: Run Last