BESCatalogCommand.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 "BESCatalogCommand.h"
00034 #include "BESTokenizer.h"
00035 #include "BESResponseHandlerList.h"
00036 #include "BESSyntaxUserError.h"
00037 #include "BESDataNames.h"
00038 #include "BESResponseNames.h"
00039
00059 BESResponseHandler *
00060 BESCatalogCommand::parse_request( BESTokenizer &tokenizer,
00061 BESDataHandlerInterface &dhi )
00062 {
00063 dhi.data[CATALOG_OR_INFO] = _cmd ;
00064
00065 string my_token = parse_options( tokenizer, dhi ) ;
00066 if( my_token == "for" )
00067 {
00068 string container = tokenizer.get_next_token() ;
00069 if( container == ";" || container == "" )
00070 {
00071 tokenizer.parse_error( container + " not expected" ) ;
00072 }
00073 dhi.data[CONTAINER] = tokenizer.remove_quotes( container ) ;
00074 my_token = tokenizer.get_next_token() ;
00075 }
00076 if( my_token != ";" )
00077 {
00078 tokenizer.parse_error( my_token + " not expected" ) ;
00079 }
00080
00081 dhi.action = CATALOG_RESPONSE ;
00082 BESResponseHandler *retResponse =
00083 BESResponseHandlerList::TheList()->find_handler( CATALOG_RESPONSE ) ;
00084 if( !retResponse )
00085 {
00086 string err( "Command " ) ;
00087 err += _cmd ;
00088 err += " does not have a registered response handler" ;
00089 throw BESSyntaxUserError( err, __FILE__, __LINE__ ) ;
00090 }
00091
00092 return retResponse ;
00093 }
00094
00101 void
00102 BESCatalogCommand::dump( ostream &strm ) const
00103 {
00104 strm << BESIndent::LMarg << "BESCatalogCommand::dump - ("
00105 << (void *)this << ")" << endl ;
00106 BESIndent::Indent() ;
00107 BESCommand::dump( strm ) ;
00108 BESIndent::UnIndent() ;
00109 }
00110