Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TRint.h
Go to the documentation of this file.
1 // @(#)root/rint:$Id$
2 // Author: Rene Brun 17/02/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 
13 #ifndef ROOT_TRint
14 #define ROOT_TRint
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // Rint //
19 // //
20 // Rint is the ROOT Interactive Interface. It allows interactive access //
21 // to the ROOT system via a C++ interpreter. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TApplication.h"
26 #include "TString.h"
27 
28 class TFileHandler;
29 
30 
31 class TRint : public TApplication {
32 
33 private:
34  Int_t fNcmd; // command history number
35  TString fDefaultPrompt; // default prompt: "root [%d] "
36  TString fNonContinuePrompt; // default prompt before continue prompt was set
37  char fPrompt[64]; // interpreter prompt
38  Bool_t fInterrupt; // if true macro execution will be stopped
39  Int_t fCaughtSignal; // TRint just caught a signal
40  TFileHandler *fInputHandler; // terminal input handler
41 
42  TRint(const TRint&); // not implemented
43  TRint& operator=(const TRint&); // not implemented
44 
45  void ExecLogon();
46  Long_t ProcessRemote(const char *line, Int_t *error = 0);
47  Long_t ProcessLineNr(const char* filestem, const char *line, Int_t *error = 0);
48 
49 public:
50  TRint(const char *appClassName, int *argc, char **argv,
51  void *options = 0, int numOptions = 0, Bool_t noLogo = kFALSE);
52  virtual ~TRint();
53  virtual char *GetPrompt();
54  virtual const char *SetPrompt(const char *newPrompt);
55  virtual void SetEchoMode(Bool_t mode);
56  virtual void HandleException(Int_t sig);
57  virtual Bool_t HandleTermInput();
58  virtual void PrintLogo(Bool_t lite = kFALSE);
59  virtual void Run(Bool_t retrn = kFALSE);
60  virtual void Terminate(int status);
61  void Interrupt() { fInterrupt = kTRUE; }
62  virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream& out);
63 
64  TFileHandler *GetInputHandler() { return fInputHandler; }
65 
66  ClassDef(TRint,0); //ROOT Interactive Application Interface
67 };
68 
69 #endif