//-------------------------------------------------------------------------- // File and Version Information: // $Id: AppXXXOutputCommand.cc,v 1.4 2005/01/04 20:54:01 murat Exp $ // // Description: // Derives from AppFileOutputCommand for XXX format // output file [] Bind stream to file // // Author List: // Kevin McFarland Original Author // //------------------------------------------------------------------------ #include "Experiment/Experiment.hh" //----------------------- // This Class's Header -- //----------------------- #include "Level3Mods/AppXXXOutputCommand.hh" //------------- // C Headers -- //------------- #include #include #include #include using std::string; //------------------------------- // Collaborating Class Headers -- //------------------------------- #include "Framework/APPFramework.hh" #include "Level3Mods/AppXXXStream.hh" #include "Framework/AppStreamsOutputModule.hh" #include "FrameUtil/AbsInterp.hh" // ---------------------------------------- // -- Public Function Member Definitions -- // ---------------------------------------- //---------------- // Constructors -- //---------------- AppXXXOutputCommand::AppXXXOutputCommand( const char* const theCommand, AppModule* theTarget ) : AppOutputCommand( theCommand, theTarget ) { } //-------------- // Destructor -- //-------------- AppXXXOutputCommand::~AppXXXOutputCommand( ) { } // ------------------------------------------- // -- Protected Function Member Definitions -- // ------------------------------------------- int AppXXXOutputCommand::helpHandler( ) const { AppStreamsOutputModule* theOutput = (AppStreamsOutputModule*)target( ); AbsInterp* interp = AbsInterp::instance( ); int result = AppOutputCommand::helpHandler( ); interp->sendPartialMessage( "\n" ); interp->sendPartialMessage( " output create [] Create stream\n" ); interp->sendPartialMessage( " output file [] Bind stream to file\n" ); return result; } AppStream* AppXXXOutputCommand::createStream( const char* theName, const char* theDestination ) { AppStream* result = new AppXXXStream( theName, theDestination ); return result; } string AppXXXOutputCommand::destinationString( ) const { return "File"; } int AppXXXOutputCommand::handleCommand( int argc, char* argv[] ) { int result = AppOutputCommand::handleCommand( argc, argv ); if ( result != AbsInterp::OK ) { if ( 0 == strcmp( argv[1], "file" ) || 0 == strcmp( argv[1], "fi" ) ) { result = destinationHandler( ); } } return result; }