// Author: I. Froehlich
// Written: 6.10.2009


#ifndef _PCOMMANDLIST_H_
#define _PCOMMANDLIST_H_

#include "TObjString.h"


class PCommandList : public TObjString {

 private:

    TObjString fCmd;  //command

    TObjString fNext;     //Next command 
    PCommandList *fNextP; //! Pointer to next command
    Int_t fLevel;         //! Level of nested objects

    TObjString fTool;  //command

 public:

    //constructor
    PCommandList();
    PCommandList(TString name);
    PCommandList(TString name, TString cmd);
    PCommandList(TObject *obj, TString name, TString cmd);
    ~PCommandList();
 
    const char *GetCmd() const {
	return fCmd.GetString().Data();
    };

    Bool_t AddCommand(const char *cmd, const char *basename = NULL, int level = 0);
    Bool_t AddCommand(TObject *obj, const char *cmd, const char *basename = NULL, int level = 0);
    Bool_t GetCommand(char **cmd, int level = 0, TObject **obj = NULL);

    using TObject::Write; 
    Int_t Write(const char *name, Int_t option, Int_t bufsize) const; 
    void Print(const Option_t *delme = NULL) const;

    ClassDef(PCommandList, 1)  //Tool class to make lists of commands
};

#endif
 PCommandList.h:1
 PCommandList.h:2
 PCommandList.h:3
 PCommandList.h:4
 PCommandList.h:5
 PCommandList.h:6
 PCommandList.h:7
 PCommandList.h:8
 PCommandList.h:9
 PCommandList.h:10
 PCommandList.h:11
 PCommandList.h:12
 PCommandList.h:13
 PCommandList.h:14
 PCommandList.h:15
 PCommandList.h:16
 PCommandList.h:17
 PCommandList.h:18
 PCommandList.h:19
 PCommandList.h:20
 PCommandList.h:21
 PCommandList.h:22
 PCommandList.h:23
 PCommandList.h:24
 PCommandList.h:25
 PCommandList.h:26
 PCommandList.h:27
 PCommandList.h:28
 PCommandList.h:29
 PCommandList.h:30
 PCommandList.h:31
 PCommandList.h:32
 PCommandList.h:33
 PCommandList.h:34
 PCommandList.h:35
 PCommandList.h:36
 PCommandList.h:37
 PCommandList.h:38
 PCommandList.h:39
 PCommandList.h:40
 PCommandList.h:41
 PCommandList.h:42
 PCommandList.h:43
 PCommandList.h:44
 PCommandList.h:45
 PCommandList.h:46
 PCommandList.h:47