Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Gdk::Spawn Class Reference

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

#include <xfc/gdk/spawn.hh>

Inheritance diagram for Xfc::Gdk::Spawn:
Xfc::G::Spawn Xfc::StackObject

List of all members.

Public Member Functions

Constructors

Detailed Description

A C++ interface for the Gdk spawn functions.

Spawn executes a child program asynchronously like G::SpawnAsync except the child process is spawned in such an environment that on calling Gdk::Display::open() it would be returned a Gdk::Display with screen as the default screen. For more details see the G::SpawnAsync class documentation.


Constructor & Destructor Documentation

Xfc::Gdk::Spawn::Spawn ( const std::vector< std::string > &  argv,
G::SpawnFlagsField  flags = 0 
)

Constructs an asynchronous spawn object with the specified arguments argv and spawn flags.

Parameters:
argvA reference to a vector of std::string that holds the child's argument strings.
flagsOne or more bitflags from the G::SpawnFlags enumeration.

The first string in argv (argv[0]) is of course the name of the program to execute. By default, the name of the program must be a full path; the PATH shell variable will only be searched if you pass the G::SPAWN_SEARCH_PATH flag.

Reimplemented from Xfc::G::Spawn.

Xfc::Gdk::Spawn::Spawn ( const std::string &  command_line,
G::Error error 
)

Constructs an asynchronous spawn object with the specified arguments in the command_line string.

Parameters:
command_lineThe command line string.
errorThe return location for a G::Error.

This constructor parses command line with g_shell_parse_argv() and passes it to GLib. If an error occurs it is set by the parsing function, and can be any of those from the G_SHELL_ERROR domain. Runs a command_line in the background. Unlike then other constructor, the G::SPAWN_SEARCH_PATH flag is enabled, other flags are not. Note that G::SPAWN_SEARCH_PATH can have security implications, so consider using the other constructor if appropriate.

Reimplemented from Xfc::G::Spawn.


Member Function Documentation

bool Xfc::Gdk::Spawn::execute ( const Screen screen,
G::Error error = 0 
)

Executes a child program asynchronously (that is, your program will not block waiting for the child to exit).

Parameters:
screenA Gdk::Screen.
errorThe return location for a G::Error, or null to ignore errors.
Returns:
true if successful, false if error is set.
bool Xfc::Gdk::Spawn::execute ( const Screen screen,
const ChildSetupSlot slot,
G::Error error = 0 
)

Executes a child program asynchronously (that is, your program will not block waiting for the child to exit).

Parameters:
screenA Gdk::Screen.
slotA sigc::slot to call in the child just before exec().
errorThe return location for a G::Error, or null to ignore errors.
Returns:
true if successful, false if error is set.
bool Xfc::Gdk::Spawn::execute ( const Screen screen,
const ChildSetupSlot slot,
int *  std_input,
int *  std_output,
int *  std_error,
G::Error error = 0 
)

Executes a child program asynchronously (that is, your program will not block waiting for the child to exit).

Parameters:
screenA Gdk::Screen.
slotA sigc::slot to call in the child just before exec().
std_inputThe return location for the file descriptor to write to child's stdin.
std_outputThe return location for the file descriptor to read child's stdout.
std_errorThe return location for the file descriptor to read child's stderr.
errorThe return location for a G::Error, or null to ignore errors.
Returns:
true if successful, false if error is set.

The file descriptors std_input, std_output, and std_error are used for writing to the child's standard input or reading from its standard output or standard error, and must be closed by calling close() when no longer required.

If std_input is null the child's standard input is attached to /dev/null unless G::SPAWN_CHILD_INHERITS_STDIN is set. If std_error is null the child's standard error goes to the same location as the parent's standard error unless G::SPAWN_STDERR_TO_DEV_NULL is set. If std_output is not called the child's standard output goes to the same location as the parent's standard output unless G::SPAWN_STDOUT_TO_DEV_NULL is set.


The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC