yast2-core
Y2StdioComponent.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: Y2StdioComponent.h
14 
15  Author: Mathias Kettner <kettner@suse.de>
16  Maintainer: Klaus Kaempf <kkaempf@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 /*
22  * Component that communicates via stdin/out/err
23  *
24  * Author: Mathias Kettner <kettner@suse.de>
25  */
26 
27 #ifndef Y2StdioComponent_h
28 #define Y2StdioComponent_h
29 
30 #include "Y2Component.h"
31 #include <ycp/Parser.h>
32 
37 {
41  const bool is_server;
42 
47  bool to_stderr;
48 
54  bool batchmode;
55 
60 
61 public:
62 
67  Y2StdioComponent (bool is_server, bool to_stderr, bool in_batchmode = false);
68 
73 
78  string name() const;
79 
85  YCPValue evaluate(const YCPValue& command);
86 
91  void result(const YCPValue& result);
92 
99  void setServerOptions(int argc, char **argv);
100 
111  YCPValue doActualWork(const YCPList& arglist, Y2Component *user_interface);
112 
113 private:
117  void send (const YCPValue& v) const;
118 
123  YCPValue receive ();
124 
125 };
126 
127 
128 #endif // Y2StdioComponent_h
YCPValue doActualWork(const YCPList &arglist, Y2Component *user_interface)
Definition: Y2StdioComponent.cc:96
Parser parser
Definition: Y2StdioComponent.h:59
~Y2StdioComponent()
Definition: Y2StdioComponent.cc:41
Interface to a component via stdio.
Definition: Y2StdioComponent.h:36
void result(const YCPValue &result)
Definition: Y2StdioComponent.cc:83
Y2StdioComponent(bool is_server, bool to_stderr, bool in_batchmode=false)
Definition: Y2StdioComponent.cc:31
void setServerOptions(int argc, char **argv)
Definition: Y2StdioComponent.cc:91
Communication handle to a YaST2 component.
Definition: Y2Component.h:262
YCPValue receive()
Definition: Y2StdioComponent.cc:144
const bool is_server
Definition: Y2StdioComponent.h:41
bool to_stderr
Definition: Y2StdioComponent.h:47
Wrapper for YCPListRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPListRep with the arrow operator. See YCPListRep.
Definition: YCPList.h:236
bool batchmode
Definition: Y2StdioComponent.h:54
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
void send(const YCPValue &v) const
Definition: Y2StdioComponent.cc:126
string name() const
Definition: Y2StdioComponent.cc:46
YCPValue evaluate(const YCPValue &command)
Definition: Y2StdioComponent.cc:54
YCP language parser.
Definition: Parser.h:64

Generated on a sunny day for yast2-core by doxygen 1.8.6