00001 // ===================================================================== 00002 // $Id: TChangeDirectoryCommand.cc,v 1.4 2004/03/07 10:30:28 goiwai Exp $ 00003 // $Name: CLDAQ-1-14-03 $ 00004 // $Log: TChangeDirectoryCommand.cc,v $ 00005 // Revision 1.4 2004/03/07 10:30:28 goiwai 00006 // ROOTに組みこむためのおまじないマクロを埋めこみました。 00007 // 全てにおいて完全に動作するわけではありません。 00008 // 00009 // Revision 1.3 2003/10/06 17:02:37 goiwai 00010 // *** empty log message *** 00011 // 00012 // Revision 1.2 2003/07/30 16:17:30 goiwai 00013 // ファイルにコミットログをつけることにしました. 00014 // 00015 // ===================================================================== 00016 #include "TChangeDirectoryCommand.hh" 00017 #include "TRunManager.hh" 00018 #include "TUserInterface.hh" 00019 00020 static const Tstring _name = "cd"; 00021 static const Tstring _desc = "change the current directory."; 00022 00023 TChangeDirectoryCommand::TChangeDirectoryCommand( TRunManager* manager ) 00024 : TCommand( manager, _name, _desc ) 00025 {;} 00026 00027 TChangeDirectoryCommand::~TChangeDirectoryCommand() 00028 {;} 00029 00030 Tvoid TChangeDirectoryCommand::Execute( const TstringList& arguments ) 00031 { 00032 TUserInterface* ui = theRunManager -> GetUserInterface(); 00033 if ( ui == 0 ) { 00034 return; 00035 } 00036 00037 if ( arguments.empty() ) { 00038 ui -> SetCurrentWorkingDirectory( "/" ); 00039 } else if ( arguments.size() == 1 ) { 00040 ui -> SetCurrentWorkingDirectory( arguments[ 0 ] ); 00041 } else { 00042 Tcerr << "TChangeDirectoryCommand::Execute: Too many arguments." << Tendl; 00043 } 00044 return; 00045 } 00046 00047 #ifdef __CLDAQ_ROOT_DLL 00048 ClassImp(TChangeDirectoryCommand) 00049 #endif