yast2-core
ExternalDataSource.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: ExternalDataSource.h
14 
15  Author: Andreas Schwab <schwab@suse.de>
16  Maintainer: Thomas Roelz <tom@suse.de>
17 
18 /-*/
19 
20 #ifndef ExternalDataSource_h
21 #define ExternalDataSource_h
22 
23 #include <stdio.h>
24 
25 #include <string>
26 
31 {
32 protected:
33  FILE *inputfile;
34  FILE *outputfile;
35 
36 private:
37  char *linebuffer;
39 
40 public:
47  ExternalDataSource(FILE *inputfile = 0, FILE *outputfile = 0);
48 
52  virtual ~ExternalDataSource();
53 
59  bool send (const char *buffer, size_t length);
60 
65  bool send (std::string s);
66 
73  size_t receive(char *buffer, size_t length);
74 
79  std::string receiveLine();
80 
85  std::string receiveUpto(char c);
91  void setBlocking(bool mode);
92 
96  virtual int close();
97 
101  FILE *inputFile() const { return inputfile; }
102 
106  FILE *outputFile() const { return outputfile; }
107 };
108 
109 
110 #endif // ExternalDataSource_h
111 

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