TABLE OF CONTENTS


Commands/Commands [ Packages ]

[ Top ] [ Packages ]

FUNCTION

 Provide code for manipulate configured Bob commands

SOURCE

package Commands is

Commands/Commands.Commands_Container [ Types ]

[ Top ] [ Commands ] [ Types ]

FUNCTION

 Used to store all available Bob commands.

SOURCE

   package Commands_Container is new Ordered_Maps(Key_Type => Unbounded_String,
      Element_Type => Command_Record);

Commands/Commands.Unbounded_String_Container [ Types ]

[ Top ] [ Commands ] [ Types ]

FUNCTION

 Used to store commands to execute

SOURCE

   package Unbounded_String_Container is new Vectors(Index_Type => Positive,
      Element_Type => Unbounded_String);

Commands/Commands.Variables_Container [ Types ]

[ Top ] [ Commands ] [ Types ]

FUNCTION

 Used to store enviroment variables for the command

SOURCE

   package Variables_Container is new Hashed_Maps(Key_Type => Unbounded_String,
      Element_Type => Unbounded_String, Hash => Ada.Strings.Unbounded.Hash,
      Equivalent_Keys => "=");

Commands/Commands.Command_Record [ Records ]

[ Top ] [ Commands ] [ Records ]

FUNCTION

 Data structure for the Bob commands.

SOURCE

   type Command_Record is record
      Execute: Unbounded_String_Container.Vector;
      Variables: Variables_Container.Map;
      Description: Unbounded_String;
      Output: Unbounded_String;
      Flags: Unbounded_String_Container.Vector;
   end record;

PARAMETERS

 Execute     - Commands or programs to execute with this command.
 Variables   - Environment variables for this command.
 Description - Description of the command. Will be show to the user with
               help command.
 Output      - Where to send output of this command. Possible options are:
               "standard" standard output (default), "error" standard
               error output, anything other will be treated as path to file
               where output should be redirected.
 Flags       - Flags assigned to this command. Possible options are:
               "unixonly" command available only on Unix systems,
               "windowsonly" command available only on Windows,
               "internal" internal command, don't show on list of
               available commands, "evaluratevariables" treat command
               variables as programs to execute and assign result to the
               variables.

Commands/Empty_Command [ Constants ]

[ Top ] [ Commands ] [ Constants ]

FUNCTION

 Empty command constant

SOURCE

   Empty_Command: constant Command_Record :=
     (Execute => Unbounded_String_Container.Empty_Vector,
      Variables => Variables_Container.Empty_Map,
      Description => Null_Unbounded_String,
      Output => To_Unbounded_String(Source => "standard"),
      Flags => Unbounded_String_Container.Empty_Vector);

Commands/Commands.Execute_Command [ Subprograms ]

[ Top ] [ Commands ] [ Subprograms ]

FUNCTION

 Execute selected Bob command

SOURCE

   procedure Execute_Command
     (Key: Unbounded_String;
      Bob_Commands_List: in out Commands_Container.Map) with
      Pre => Key /= Null_Unbounded_String,
      Test_Case => (Name => "Test_ExecuteCommand", Mode => Nominal);

PARAMETERS

 Bob_Commands_List - The list of the program commands
 Key               - Command name which the user entered as a first
                     parameter for the program