Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/CdbTools/CdbToolsCmd.cc

Go to the documentation of this file.
00001 //
00002 //
00003 //
00004 //
00005 #include <string.h>
00006 
00007 #include "CdbTools/CdbToolsCmd.hh"
00008 #include "CdbTools/CdbToolslsCmd.hh"
00009 #include "CdbTools/CdbToolscdCmd.hh"
00010 #include "CdbTools/CdbToolshelpCmd.hh"
00011 #include "CdbTools/CdbToolsexitCmd.hh"
00012 
00013 
00014 CdbToolsCmd::CdbToolsCmd(CdbToolsContext* context)
00015 {
00016   _context = context;
00017 }
00018 CdbToolsCmd::~CdbToolsCmd()
00019 {
00020 
00021 }
00022 void
00023 CdbToolsCmd::readArgs(char* buff)
00024 {
00025   char* token = " ,\"";     //token can either be white space or comma
00026 
00027   clearArgs();           //clear the arg list 
00028   char* temp;
00029    temp = strtok(buff, token);
00030   if(temp == 0)return;     //empty buffer
00031   //fill the arg list
00032   //need to check for composite argument with ""
00033   _argv.push_back(std::string(temp));
00034   while(temp = strtok(0, token)){
00035     _argv.push_back(std::string(temp));
00036   }
00037 }
00038 std::string
00039 CdbToolsCmd::argv(int index)const
00040 {
00041   if(argc()>index)
00042     return _argv[index];
00043   else
00044     return "";
00045 }
00046 void
00047 CdbToolsCmd::clearArgs()
00048 {
00049 
00050  _argv.clear();
00051  resetIndent();
00052 }
00053 CdbToolsStatus::CdbCmdStatus
00054 CdbToolsCmd::execute()
00055 {
00056   CdbToolsStatus::CdbCmdStatus status =CdbToolsStatus::Error;
00057   //start transaction
00058     //_cdbTrans->start();
00059     status = doExecute();
00060   //end transaction
00061   //_cdbTrans->commit();
00062   return status;
00063 }
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002