Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2StdioComponent Class Reference

Interface to a component via stdio. More...

#include <Y2StdioComponent.h>

Inheritance diagram for Y2StdioComponent:

Y2Component List of all members.

Public Member Functions

 Y2StdioComponent (bool is_server, bool to_stderr, bool in_batchmode=false)
 ~Y2StdioComponent ()
string name () const
YCPValue evaluate (const YCPValue &command)
void result (const YCPValue &result)
void setServerOptions (int argc, char **argv)
YCPValue doActualWork (const YCPList &arglist, Y2Component *user_interface)

Private Member Functions

void send (const YCPValue &v) const
YCPValue receive ()

Private Attributes

const bool is_server
bool to_stderr
bool batchmode
Parser parser

Detailed Description

Interface to a component via stdio.


Constructor & Destructor Documentation

Y2StdioComponent::Y2StdioComponent bool  is_server,
bool  to_stderr,
bool  in_batchmode = false
 

Creates a new cat/stdio component.

Parameters:
to_stderr: give true, if stderr should be used instead of stdout.

Y2StdioComponent::~Y2StdioComponent  ) 
 

Cleans up


Member Function Documentation

YCPValue Y2StdioComponent::doActualWork const YCPList arglist,
Y2Component user_interface
[virtual]
 

Here the client does its actual work.

Parameters:
arglist YCPList of client arguments.
user_interface Option display server (user interface)
Returns:
The result value (exit code) of the called client. The result code has not yet been sent to the display server. Destroy it after use.
This method is only defined, if the component is a client.

Reimplemented from Y2Component.

YCPValue Y2StdioComponent::evaluate const YCPValue command  )  [virtual]
 

Defined only for the "cat" component: Prints a command to stdout and waits for the answer on stdin.

Reimplemented from Y2Component.

string Y2StdioComponent::name  )  const [virtual]
 

Returns "cat", if this is a server, or "stdio" if it's a module.

Implements Y2Component.

YCPValue Y2StdioComponent::receive  )  [private]
 

Reads one YCP value from stdin. Return 0 if no one could be read.

void Y2StdioComponent::result const YCPValue result  )  [virtual]
 

Defined only for the "cat" component: Prints result(..result..) on stdout.

Reimplemented from Y2Component.

void Y2StdioComponent::send const YCPValue v  )  const [private]
 

Sends a YCP value to stdout.

void Y2StdioComponent::setServerOptions int  argc,
char **  argv
[virtual]
 

Sets the commandline options of the server. Server options for the cat server are simply ignored.

This method is only defined, if the component is a server.

Reimplemented from Y2Component.


Member Data Documentation

bool Y2StdioComponent::batchmode [private]
 

If true, we're running in batchmode (i.e testsuite) As a client (called via doActualWork()) nothing changes As a server (called via evaluate()) no input is read

const bool Y2StdioComponent::is_server [private]
 

It this component a server or a client?

Parser Y2StdioComponent::parser [private]
 

Parser used to parse stdin

bool Y2StdioComponent::to_stderr [private]
 

If true, this is the 'stderr' component, which reads from stdin, but writes to stderr.


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:24 2007 for yast2-core by doxygen 1.3.6