main.cxx

Go to the documentation of this file.
00001 // @(#)root/test/RootIDE/:$Id: main.cxx 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Bertrand Bellenot   20/04/2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #include <stdio.h>
00013 
00014 #include <TSystem.h>
00015 #include <TApplication.h> 
00016 #include <TRint.h>
00017 #include "TGRootIDE.h"
00018 
00019 //----------------------------------------------------------------------
00020 
00021 int main(int argc, char *argv[]) 
00022 {
00023 
00024    TString *fname = 0;
00025    for (int i = 0; i < argc; i++) {
00026       if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-?")) {
00027          printf("Usage: %s [-h | -?] [filename]\n", argv[0]);
00028          printf("    -h, -?:     this message\n");
00029          printf("  filename:     name of the file to open in ROOT IDE\n");
00030          return 0;
00031       }
00032       if ((i > 0) && (!gSystem->AccessPathName(argv[i]))) {
00033          fname = new TString(argv[i]);
00034          // don't pass filename arg to TRint (avoid processing file)
00035          argv[i] = 0;
00036          argc--;
00037       }
00038    }
00039 
00040    TApplication *theApp = new TRint("App", &argc, argv);
00041 
00042    new TGRootIDE(fname ? fname->Data() : 0);
00043 
00044    theApp->Run();
00045    return 0;
00046 }

Generated on Tue Jul 5 15:15:08 2011 for ROOT_528-00b_version by  doxygen 1.5.1