Top | ![]() |
![]() |
![]() |
![]() |
GGrnCommand * | ggrn_command_new () |
void | ggrn_command_add_argument () |
gchar * | ggrn_command_escape () |
gchar * | ggrn_command_escape_query () |
gchar * | ggrn_command_execute () |
gchar * | ggrn_command_to_path () |
gchar * | ggrn_command_to_command_line () |
GGrnContext * | context | Read / Write / Construct Only |
gchar * | name | Read / Write / Construct Only |
GGrnCommand * ggrn_command_new (GGrnContext *context
,const gchar *name
);
Allocates a new GGrnCommand.
Since 1.0.0
void ggrn_command_add_argument (GGrnCommand *command
,const gchar *name
,const gchar *value
);
Adds an argument of the command.
If you add the same name argument twice, the old argument value is overrode.
Since 1.0.0
gchar * ggrn_command_escape (GGrnCommand *command
,const gchar *value
,const gchar *target_characters
,char escape_character
);
Escapes target_characters
in value
by escape_chracter
.
For example:
1 2 3 4 5 6 7 |
gchar *escaped; escaped = ggrn_command_escape(command, "aA'\"()19", "'\"()", '\\'); g_print("%s\n", escaped); // -> aA\'\"\(\)19 g_free(escaped); |
command |
A GGrnCommand. |
|
value |
The argument value. |
|
target_characters |
The characters to be escaped. |
|
escape_character |
The character to escape a character. |
The escaped characters. It must be freed with
g_free()
when no longer needed.
It returns NULL
for invalid input.
Since 1.0.1
gchar * ggrn_command_escape_query (GGrnCommand *command
,const gchar *query
);
Escapes special characters of query
syntax
in query
.
For example:
1 2 3 4 |
gchar *escaped_query; escaped_query = ggrn_command_escape_query(command, "column:aA'\"()19"); g_print("%s\n", escaped_query); // -> column\:aA'\"\(\)19 g_free(escaped_query); |
The escaped query. It must be freed with
g_free()
when no longer needed.
It returns NULL
for invalid input.
Since 1.0.1
gchar *
ggrn_command_execute (GGrnCommand *command
);
Executes the command and returns the executed result.
Since 1.0.0
gchar *
ggrn_command_to_path (GGrnCommand *command
);
Formats the command as path format like the following:
1 |
/d/table_create?name=Logs&flags=TABLE_NO_KEY |
Since 1.0.0
gchar *
ggrn_command_to_command_line (GGrnCommand *command
);
Formats the command as command line format like the following:
1 |
table_create --name Logs --flags TABLE_NO_KEY |
Since 1.0.0
struct GGrnCommand;
A GGrnCommand is an object to create a Groonga command string. It
is executable by ggrn_context_execute_command()
.
“context”
property“context” GGrnContext *
The context for the command.
Flags: Read / Write / Construct Only