StandAloneClient.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef StandAloneClient_h
00034 #define StandAloneClient_h 1
00035
00036 #include <iostream>
00037 #include <string>
00038 #include <fstream>
00039
00040 using std::ostream ;
00041 using std::ifstream ;
00042 using std::string ;
00043
00044 #include "BESObj.h"
00045
00073 class StandAloneClient : public BESObj
00074 {
00075 private:
00076 ostream * _strm ;
00077 bool _strmCreated ;
00078 bool _isInteractive ;
00079
00080 size_t readLine( string &str ) ;
00081 void displayHelp() ;
00082 void executeCommand( const string &cmd,
00083 int repeat ) ;
00084 public:
00085 StandAloneClient( )
00086 : _strm( 0 ),
00087 _strmCreated( false ),
00088 _isInteractive( false ) {}
00089 ~StandAloneClient() ;
00090
00091 void setOutput( ostream *strm, bool created ) ;
00092 void executeClientCommand( const string &cmd ) ;
00093 void executeCommands( const string &cmd_list,
00094 int repeat ) ;
00095 void executeCommands( ifstream &inputFile,
00096 int repeat ) ;
00097 void interact() ;
00098
00099 virtual void dump( ostream &strm ) const ;
00100 } ;
00101
00102 #endif // StandAloneClient_h
00103