GGrnCommand

GGrnCommand — An object to create a Groonga command.

Synopsis

struct              GGrnCommand;
struct              GGrnCommandClass;
GGrnCommand *       ggrn_command_new                    (GGrnContext *context,
                                                         const gchar *name);
void                ggrn_command_add_argument           (GGrnCommand *command,
                                                         const gchar *name,
                                                         const gchar *value);
gchar *             ggrn_command_execute                (GGrnCommand *command);
gchar *             ggrn_command_to_path                (GGrnCommand *command);
gchar *             ggrn_command_to_command_line        (GGrnCommand *command);

Object Hierarchy

  GObject
   +----GGrnCommand

Properties

  "context"                  GGrnContext*          : Read / Write / Construct Only
  "name"                     gchar*                : Read / Write / Construct Only

Description

The GGrnCommand is a class to create a Groonga command string.

Details

struct GGrnCommand

struct GGrnCommand;

A GGrnCommand is an object to create a Groonga command string. It is executable by ggrn_context_execute_command().


struct GGrnCommandClass

struct GGrnCommandClass {
    GObjectClass parent_class;
};


ggrn_command_new ()

GGrnCommand *       ggrn_command_new                    (GGrnContext *context,
                                                         const gchar *name);

Allocates a new GGrnCommand.

Returns :

a new GGrnCommand.

Since 1.0.0


ggrn_command_add_argument ()

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.

command :

A GGrnCommand.

name :

The name of the argument.

value :

The value of the argument.

Since 1.0.0


ggrn_command_execute ()

gchar *             ggrn_command_execute                (GGrnCommand *command);

Executes the command and returns the executed result.

command :

A GGrnCommand.

Returns :

The executed result of command. It must be freed with g_free() when no longer needed.

Since 1.0.0


ggrn_command_to_path ()

gchar *             ggrn_command_to_path                (GGrnCommand *command);

Formats the command as path format like the following:

/d/table_create?name=Logs&flags=TABLE_NO_KEY

command :

A GGrnCommand.

Returns :

The path format command. It must be freed with g_free() when no longer needed.

Since 1.0.0


ggrn_command_to_command_line ()

gchar *             ggrn_command_to_command_line        (GGrnCommand *command);

Formats the command as command line format like the following:

table_create --name Logs --flags TABLE_NO_KEY

command :

A GGrnCommand.

Returns :

The command line format command. It must be freed with g_free() when no longer needed.

Since 1.0.0

Property Details

The "context" property

  "context"                  GGrnContext*          : Read / Write / Construct Only

The context for the command.


The "name" property

  "name"                     gchar*                : Read / Write / Construct Only

The name of the command.

Default value: NULL