Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::G::Spawn Class Reference

A C++ interface for the GLib spawn functions. More...

#include <inti/glib/spawn.h>

Inheritance diagram for Inti::G::Spawn:

Inti::StackObject Inti::G::SpawnAsync Inti::G::SpawnSync List of all members.

Public Types

Public Member Functions

Constructors
Methods

Protected Member Functions

Constructors
Accessors
Methods

Detailed Description

A C++ interface for the GLib spawn functions.

Rather than wrap the GLib spawn functions individually Inti wraps these functions into two easy to use classes: SpawnAsync and SpawnSync. SpawnAync executes a child program asynchronously (your program will not block waiting for the child to exit) and SpawnSync executes a child synchronously (your program waits for the child to exit before returning).

Spawn is just a convenient base class that implements the code common to both SpawnAsync and SpawnSync. It derives from StackObject so you can only create SpawnAsync and SpawnSync on the stack. Spawn has only two public methods that can be called: set_working_directory() and set_enviroment(). You call set_working_directory() to set the child's current working directory and you call set_enviroment() to set the child's environment. If you call neither of these methods the child will inherit its parent's working directory and enviroment.


Member Typedef Documentation

typedef Slot0<void> Inti::G::Spawn::ChildSetupSlot
 

Signature of the callback slot to be called after GLib has performed all the setup it plans to perform but before calling exec().

Example: Method signature for ChildSetupSlot.

             void method();

Obviously, actions taken in this method will only affect the child, not the parent.


Member Function Documentation

void Inti::G::Spawn::set_arguments const std::string &  command_line,
G::Error error
[protected]
 

Sets the child arguments from the command_line string.

Parameters:
command_line A command line.
error The return location for a G::Error.

This method sets the G_SPAWN_SEARCH_PATH flags and unsets all others.

void Inti::G::Spawn::set_arguments const std::vector< std::string > &  argv,
SpawnFlagsField  flags
[protected]
 

Sets the child arguments and spawn flags.

Parameters:
argv A reference to a vector of std::string that holds the argument strings.
flags The spawn flags to set.

void Inti::G::Spawn::set_enviroment std::vector< std::string > &  envp  ) 
 

Sets the child's enviroment.

Parameters:
envp A reference to a vector of std::string that holds the child's enviroment strings.

Each string in the vector must has the form KEY=VALUE. This will become the child's environment. If not specifically set a child will inherit its parent's enviroment.

void Inti::G::Spawn::set_working_directory const std::string &  working_directory  ) 
 

Sets the child's current working directory.

Parameters:
working_directory The working directory to set.

If not specifically set a child will inherit its parent's working directory.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:09 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002