Main Page | Class List | File List | Class Members

sven_ui::CommandLineProgram Struct Reference

this is the first time i've ever felt it appropriate to do implementation hiding. More...

#include <command_line_program.h>

List of all members.

Public Member Functions

void create_process (cstring name)
 start a process having the given name.
void terminate_threads ()
 join the watching threads, which implicitly reads all the remaing readable pipe data.
void write_line (cstring s)
 give a command to the program.
string read ()
 read from the program's output buffer.
string read_error ()
 read from the programs error buffer;
bool process_is_dead ()
 tell us if the command line process is still active.
void finish ()
 wait for the process to complete, then terminate the threads.

Public Attributes

bool & seperate_std_error
 determimes whether or not STD_ERROR should be watched seperatly from STD_OUT.
bool & writeable
 a boolean that controls whether or not we can write to the stdin of the given process.


Detailed Description

this is the first time i've ever felt it appropriate to do implementation hiding.

mostly, i'm hiding the CommandLineProgram implemenation class because i'd prefer not to expose the boost theading header files, they take a while to process, and generate a lot of garbage warnings in msvc, and i'd rather not to have them included in every source file that uses this command line program struct.

Definition at line 34 of file command_line_program.h.


Member Function Documentation

void sven_ui::CommandLineProgram::finish  ) 
 

wait for the process to complete, then terminate the threads.

after finish has been called, the output of read() is gauranteed to be the completation of the processes output.

Definition at line 690 of file command_line_program.cpp.

void sven_ui::CommandLineProgram::terminate_threads  ) 
 

join the watching threads, which implicitly reads all the remaing readable pipe data.

then cleanup the pipe handles.

Definition at line 692 of file command_line_program.cpp.


Member Data Documentation

bool& sven_ui::CommandLineProgram::writeable
 

a boolean that controls whether or not we can write to the stdin of the given process.

defaults to true.

Definition at line 90 of file command_line_program.h.


The documentation for this struct was generated from the following files:
Generated on Mon Mar 17 12:13:59 2008 for Command Line Demo by  doxygen 1.3.9.1