Main Page | Class List | File List | Class Members

cmd_demo.cpp

Go to the documentation of this file.
00001 
00002 
00003 
00023 /*
00024 This documentation itself is part of my ongoing experiments with SVN hook scripts -- 
00025 the idea here is that, rather than just building the demo 
00026 using a snapshot of the CommandLine implementation, the web docs can be kept
00027 up to date automagically using post-commit scripts -- despite the fact that
00028 the files involved come from two different projects.
00029 */
00030 #include <iostream>
00031 #include <sven_ui/command_line_program.h>
00032 
00033 void main() {
00034 
00035         using namespace std;
00036         using namespace sven_ui;
00037 
00038         CommandLineProgram foo("cmd");
00039 
00040         foo.write_line("dir");
00041         thread_sleep(.1);
00042         cout << foo.read() << endl;
00043 
00044         foo.write_line("cd ..");
00045         thread_sleep(.1);
00046         cout << foo.read() << endl;
00047 
00048         foo.write_line("dir");
00049         thread_sleep(.1);
00050         cout << foo.read() << endl;
00051 
00052         foo.write_line("exit");
00053         thread_sleep(.1);
00054         cout << foo.read() << endl;
00055 
00056         //(try to execute a command, even though the process should be dead.)
00057         foo.write_line("dir");
00058         thread_sleep(.1);
00059         cout << foo.read() << endl;
00060 
00061         cout << foo.read() << endl;
00062 }

Generated on Mon Mar 17 12:13:59 2008 for Command Line Demo by  doxygen 1.3.9.1