00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "dtoolbase.h"
00020 #include "pfstream.h"
00021
00022 int
00023 main(int argc, char *argv[]) {
00024 if (argc < 2) {
00025 cout << "test_pfstream command-line\n";
00026 return (1);
00027 }
00028
00029
00030 string cmd;
00031 cmd = argv[1];
00032 for (int i = 2; i < argc; i++) {
00033 cmd += " ";
00034 cmd += argv[i];
00035 }
00036
00037 cout << "Executing command:\n" << cmd << "\n";
00038
00039 IPipeStream in(cmd);
00040
00041 char c;
00042 c = in.get();
00043 while (in && !in.fail() && !in.eof()) {
00044 cout.put(toupper(c));
00045 c = in.get();
00046 }
00047
00048 return (0);
00049 }