BESShowCommand.cc
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 #include "BESShowCommand.h"
00034 #include "BESTokenizer.h"
00035 #include "BESResponseHandlerList.h"
00036 #include "BESSyntaxUserError.h"
00037
00058 BESResponseHandler *
00059 BESShowCommand::parse_request( BESTokenizer &tokenizer,
00060 BESDataHandlerInterface &dhi )
00061 {
00062 BESResponseHandler *retResponse = 0 ;
00063
00064 string my_token = parse_options( tokenizer, dhi ) ;
00065
00066
00067
00068
00069
00070 string newcmd = _cmd + "." + my_token ;
00071 BESCommand *cmdobj = BESCommand::find_command( newcmd ) ;
00072 if( cmdobj && cmdobj != BESCommand::TermCommand )
00073 {
00074 retResponse = cmdobj->parse_request( tokenizer, dhi ) ;
00075 }
00076 else
00077 {
00078 dhi.action = newcmd ;
00079 retResponse =
00080 BESResponseHandlerList::TheList()->find_handler( newcmd ) ;
00081 if( !retResponse )
00082 {
00083 string err( "Command " ) ;
00084 err += _cmd + " " + my_token ;
00085 err += " does not have a registered response handler" ;
00086 throw BESSyntaxUserError( err, __FILE__, __LINE__ ) ;
00087 }
00088
00089 my_token = tokenizer.get_next_token() ;
00090 if( my_token != ";" )
00091 {
00092 tokenizer.parse_error( my_token + " not expected" ) ;
00093 }
00094 }
00095
00096 return retResponse ;
00097 }
00098
00105 void
00106 BESShowCommand::dump( ostream &strm ) const
00107 {
00108 strm << BESIndent::LMarg << "BESShowCommand::dump - ("
00109 << (void *)this << ")" << endl ;
00110 BESIndent::Indent() ;
00111 BESCommand::dump( strm ) ;
00112 BESIndent::UnIndent() ;
00113 }
00114